Guides ·

How to convert DXF to SVG for laser cutting

Many laser programs and design tools prefer SVG to DXF. A few things decide whether the SVG cuts right: its true size, its background, how layers and colours come across, and what happens to circles and text. Here they are, shown on our smiley keychain with a cut layer and an engrave layer.

Open your DXF on the free unmake DXF to SVG page, untick what shouldn't be cut, and download a true-size, transparent SVG.Try it on your own file
The layered smiley keychain DXF on the unmake DXF to SVG page: size 60.00 × 67.00 mm, a red cut outline, blue eyes and smile, a grey label, and the layers 0, CUT, ENGRAVE and NOTES
smiley-keychain-layers.dxf: red CUT, blue ENGRAVE and a grey NOTES label that shouldn't go to the laser. File: made by unmake.

What changes between DXF and SVG

A DXF describes a drawing as CAD entities: a CIRCLE with a centre and a radius, a POLYLINE with its points, TEXT with a height. Its y axis points up, as on graph paper. An SVG, the vector format of the web and of design tools, describes paths, and its y axis points down from the top-left corner.

So a converter rewrites every entity as a path and flips the drawing. Circles and arcs often become chains of short straight lines: the unmake converter writes 72 per full circle, which a laser follows smoothly on parts this size, though some programs show them as many nodes.

DXF to SVG: the DXF stores circles and polylines as numbers with the y axis pointing up; the SVG stores paths in millimetres with y pointing down, on a page 62.4 mm wide for the 60 mm keychain, and each circle becomes 72 short straight lines
Same keychain, two formats: CAD entities with y up, then paths in millimetres with y down.

True size: width and height in millimetres

An SVG can state its real size in its first lines: width="62.4mm" height="62.4mm" with a viewBox of 0 0 62.4 62.4, which makes one unit inside the file one millimetre. Programs that read those units import the part at true size.

Without units, a width counts pixels, and the program has to guess how many pixels make an inch. That is why LightBurn's import settings ask whether SVGs are 96 DPI, Inkscape's default, or 72 DPI, Illustrator's. A file sized in millimetres states its size outright; still measure one known length after import.

Background and border

A laser program treats every shape in the file as artwork, so a white rectangle behind the drawing is one more shape to find and delete. A transparent background avoids it, and it is the default in the unmake export.

The page also leaves a small empty border round the drawing, so nothing at the edge is clipped: the 60 mm keychain sits on a 62.4 mm square page. The shapes inside stay exactly 60 mm.

Layers and colours

DXF layers become SVG groups named after the layer, and each line keeps its layer's colour. That matters because laser software sorts by colour. LightBurn matches imported colours to its palette, where 01 is blue (0, 0, 255) and 02 is red (255, 0, 0), and exact matches land on their own layers, each with its own speed and power.

So a DXF with a red CUT layer and a blue ENGRAVE layer comes in ready for two settings. Black lines only, meant for printing, turns every line black: the groups stay, but the colours that sort them into laser layers are gone.

The export box: PDF, SVG and PNG, What set to Whole layout, Background set to Transparent, an unticked Black lines only box and a Download SVG button
The export box: Whole layout, Transparent background, Black lines only left off for a laser file.

Text and hidden layers

Text stays text in the SVG, in a sans-serif font. LightBurn uses fonts installed on your computer, not embedded ones, so convert text to paths in Inkscape or Illustrator if it must be engraved exactly.

Untick a layer in the viewer and it is left out of the SVG, but the page keeps the size of the whole drawing: with our NOTES layer off, the SVG was still 62.68 × 69.68 mm, with the 60 mm keychain inside it at true size.

Converting in the browser

The free unmake DXF to SVG page converts in the browser; the file stays on your device unless you press Share. Open the DXF, read the size and the layer list, untick what you don't want, and press Convert to SVG. The export box offers What (Whole layout or What's on screen), Background (White, Dark or Transparent) and Black lines only.

After Download SVG, the page reads the file back and says what is in it, such as "5 lines and shapes, 0 texts, 1 layer; size 62.4 × 62.4 mm". Units, open paths and doubled lines are the DXF's own problems and carry over; our post on checking a DXF before laser cutting covers them.

A worked example: the smiley keychain, cut and engrave

  1. Start with the plain keychain from our DXF check post, smiley-keychain.dxf, all 5 shapes on layer 0. Its SVG reads "5 lines and shapes, 0 texts, 1 layer; size 62.4 × 62.4 mm", and every line is black, so a laser program would put it all on one layer.
  2. Now the layered copy, smiley-keychain-layers.dxf: the disc and key-ring hole on a red CUT layer, the eyes and smile on a blue ENGRAVE layer, and a grey NOTES label. Size reads 60.00 × 67.00 mm, because the label sits below the disc.
  3. Export with every layer on: "5 lines and shapes, 1 text, 3 layers; size 62.7 × 69.7 mm."
  4. Untick NOTES and export again: "5 lines and shapes, 0 texts, 2 layers." Inside the file: width="62.68mm", a group layer-CUT drawn in rgb(255,0,0), a group layer-ENGRAVE in rgb(0,0,255), and no background.
  5. Each circle is a path of 72 straight segments; the outline still spans exactly 60 mm.
  6. Red and blue are exact matches for LightBurn's palette colours 02 and 01, so by LightBurn's documentation they import onto two layers: cut settings on one, engrave settings on the other.

Common mistakes

Questions

Will the SVG be the right size in my laser software?

When the DXF knows its unit, the SVG carries its width and height in millimetres. Measure one known length after import to be sure.

Are DXF layers kept when I convert DXF to SVG?

Yes, as groups named after the layers, and each line keeps its layer's colour. Layers you untick are left out.

Why are my circles made of straight lines?

The converter writes each circle as 72 short segments. Lasers follow them smoothly; some programs simply show many nodes.

Does converting fix open paths or a wrong unit?

No. Those are problems in the DXF itself and carry over to the SVG, so check the DXF first.

Sample file: smiley-keychain-layers.dxf (our 60 mm keychain on CUT, ENGRAVE and NOTES layers) · ours (made by unmake for this post)

Sources

Open your DXF on the free unmake DXF to SVG page, untick what shouldn't be cut, and download a true-size, transparent SVG.Try it on your own file