← Back to Home

DXF to G-code

DXF to G-code converter, online and free

Nestpact turns a DXF, DWG, or SVG drawing straight into machine-ready G-code in your browser. Upload a file, preview the toolpath, and download a .nc program for your laser, plasma, waterjet, or CNC router. No nesting and no CAD round-trip — the drawing keeps its exact layout.

Closed outlines become profile cuts, interior loops become cut-outs, and engrave or score features on other layers are kept and traced separately. Set your units, controller, tabs, and lead-in/out, then export.

It runs entirely in the browser with nothing to install, works in metric millimetres or US inches, and there is a free plan.

Start nesting freeRuns in your browser. No install.
DXF · DWG · SVGDrop in any common 2D vector drawing
2D + ZFlat laser/plasma G-code, or router mode with plunge/retract
Per-controllerFanuc, GRBL, Mach3/4, LinuxCNC, Haas, Mazak dialects
  • Upload a DXF, DWG, or SVG — the original drawing layout is preserved
  • Live toolpath preview and a step-through cut simulation before you export
  • Tabs / micro-joints so parts do not drop mid-cut
  • Lead-in / lead-out so the pierce mark lands off the finished edge
  • Kerf compensation and per-layer routing for cut, engrave, and mark
  • Router mode with Z plunge / retract, stepdown passes, and spindle RPM
  • Post-processor: target controller, G90/G91, and custom header / footer blocks

DXF to G-code without the CAM detour

If your part is already drawn — a logo, a bracket, a gasket, a sign — you do not need a full CAM package to cut it. A DXF to G-code converter takes the geometry as-is and emits the toolpath, which is faster for one-off and small-batch work.

Nestpact reads the drawing, groups each closed outline with its holes and engrave features, orders the cut path so the head travels less between parts, and writes a clean G-code program you can send to the controller.

What gets converted

Every closed contour becomes a profile cut. A loop inside another loop becomes a cut-out (a hole) of the part it sits in. Geometry on a different layer or colour — typical for engrave, score, and mark — is preserved as a separate operation and traced rather than profiled.

Upload a messy file? The built-in DXF health checker can close open contours, drop duplicates, and strip stray entities first, so the converter sees clean geometry.

Laser, plasma, waterjet, and CNC router

For laser, plasma, and waterjet the converter emits a 2D program: pierce, lead-in, profile, lead-out, with optional tabs. For a CNC router, turn on router mode to add a Z column — plunge to cut depth, retract to a safe height across tabs, stepdown passes for thick stock, and a spindle speed.

Pick the controller dialect (Fanuc / ISO, GRBL, Mach3/4, LinuxCNC, Haas, Mazak) so the preamble and wrapper match what your machine expects, and add custom header / footer blocks for coolant, vacuum, or probe routines.

Preview before you cut

Every conversion opens in the same viewer the nesting tool uses: a 2D or tilted 3D view of the toolpath, a play / step-through simulation, estimated cut and rapid time, pierce count, and the highlighted G-code line by line. You see exactly what the machine will do before you commit a sheet.

Recommended starting settings

A sensible starting point for converting a 2D drawing to a clean cut program. Adjust kerf to a measured test cut and pick the controller your machine speaks.

Unitsmm or in

The G-code header (G21 / G20) and all coordinates follow this.

TabsOn for free parts

Leave small uncut bridges so cut parts stay in the sheet until you pop them out.

Lead-in / outLine or arc

Keeps the pierce mark off the finished edge — important for laser and plasma.

ControllerMatch your machine

Fanuc/ISO is the safe default; pick GRBL, Mach3, LinuxCNC, etc. as needed.

Frequently asked questions

Is the DXF to G-code converter free?

Yes. Nestpact has a free plan and the converter runs in your browser with nothing to install. Upload a DXF, DWG, or SVG, preview the toolpath, and download the G-code.

What file types can I convert to G-code?

DXF, DWG, and SVG. Closed outlines become profile cuts, interior loops become cut-outs, and engrave / score layers are kept as separate operations.

Does it support my CNC controller?

The post-processor targets common dialects — Fanuc / ISO, GRBL, Mach3, Mach4, LinuxCNC, Haas, and Mazak — and lets you add custom header and footer G-code. Fanuc / ISO is a safe generic default.

Can it generate router (milling) toolpaths with a Z axis?

Yes. Turn on router mode to emit Z plunge / retract columns, stepdown passes for thick material, and a spindle speed, with the bit lifting clear over every tab bridge.

What is the difference between this and the nesting tool?

The converter keeps your drawing exactly as drawn and just emits the toolpath. The nesting tool rearranges many parts onto a sheet for maximum material yield first, then exports. Use the converter for a drawing that is already laid out; use nesting to pack parts tightly.