Free calculator

DXF to G-Code Converter β€” Turn a 2D Drawing into a CNC Program in the Browser

Open a 2D DXF drawing and get a program for milling, engraving, plasma or laser. Contours are joined automatically, arcs stay real arcs and inside shapes are cut before the outer one. A sample plate is loaded so you can try it at once.

ASCII DXF. The file never leaves your computer.

Drawing size–mm
Contours–
Total cut length–mm, all passes
Cutting time–min, estimated
G-code (arcs stay arcs: G02/G03)

How it works

Polyline bulge to arc: bulge = tan(angle / 4), centre offset from the middle of the chord = chord Γ— (1/bulge βˆ’ bulge) / 4. Line ends closer than 0.02 mm are treated as connected.

Preparing the drawing

  • Save as ASCII DXF, version R12 or 2000.
  • Explode blocks and text, convert splines and ellipses to polylines or arcs.
  • Delete dimensions, frames and construction lines. Everything that is left will be cut.
  • Check the size shown under the preview. If it is 25.4 times too small, choose Drawing in inch.

On the line or with G41?

"On the line" moves the tool centre along the drawing. That is right for engraving, drag knives and for lasers with small kerf. "Beside the line" adds G41 with a lead-in, so the control shifts the path by the radius in offset D01. Inner shapes are cut on the inside and the outer shape on the outside. GRBL does not support G41, so use an offset in the drawing there.

Embed this calculator on your site

Free for workshops, schools and forums β€” copy this snippet:

HTML
<iframe src="https://cnccode.com/embed/dxf-to-gcode/" width="100%" height="720" style="border:0" loading="lazy" title="DXF to G-Code Converter"></iframe>

More free CNC tools

Frequently asked questions

Is my drawing uploaded?
No. The file is converted inside your browser.
Which DXF objects are supported?
LINE, ARC, CIRCLE, LWPOLYLINE and POLYLINE, including arc segments in polylines. Splines, ellipses, text, hatches and blocks are listed as ignored.
Can I use it for plasma or laser?
You can use the path, but replace the Z moves and spindle codes with the on and off codes of your machine, usually M03 and M05 or M04 with S for power.
Was this page helpful?