Skip to main content

DXF to SVG converter

Turn a DXF drawing into an SVG with one group per CAD layer, real millimetre dimensions from $INSUNITS, and arcs kept as curves rather than polygons.

Runs in this tabNo uploadNo watermarkFree and unlimited

A DXF and an SVG describe the same thing — flat geometry — but they disagree about almost everything else: the DXF puts Y upward and stores arcs as a centre, a radius and two angles, while the SVG puts Y downward and stores curves as Bézier segments. This converter does that translation in the tab. Each CAD layer becomes an SVG group tagged so Inkscape shows it in its own layer panel, every circle and arc becomes a cubic Bézier rather than a many-sided polygon, and the root element carries a physical width and height in millimetres whenever the DXF declared its units. Blocks are expanded in place, TEXT and MTEXT become real text elements, and anything the renderer cannot draw is counted and named on screen.

Key facts about DXF to SVG converter

Key facts about DXF to SVG converter
Layer structureone <g> per CAD layer, carrying inkscape:groupmode="layer" and inkscape:label, so Inkscape opens the file with the CAD layers intact
Physical sizewidth and height are written in millimetres (width="124.8mm") when $INSUNITS is set, and the viewBox uses the same units
Arcs and circlesconverted to cubic Béziers at no more than 90° per segment — radial error below 0.0003 × radius, not a faceted polygon
SplinesSPLINE is evaluated with de Boor's algorithm and written as a sampled polyline, which is an approximation and is the one lossy step in this direction
Polyline bulgesthe bulge value on a LWPOLYLINE or POLYLINE vertex is converted back to a true arc, so slots and filleted corners stay round
TextTEXT and MTEXT become <text> with text-anchor and dominant-baseline set from the DXF alignment codes; MTEXT formatting codes such as \P and \f are stripped
Strokea single stroke-width per layer group, adjustable from 0.05 to 2 units, defaulting to a 0.25 mm hairline
Colourper-entity stroke from the layer colour, the ACI index or a 24-bit true colour — or forced to black for cutting
Coordinate precision3 decimal places, which is a micron at millimetre scale and keeps the file small
Measured outputa 13.6 MB DXF of 160,000 line entities writes a 9.1 MB SVG in about 0.14 s
Not transferredline types, lineweights, hatch patterns, dimension styles, paper-space viewports and the CAD font itself

What happens to your file

The DXF never leaves the tab. The File API hands the bytes to JavaScript already running on the page, the parser turns them into an object in memory, and the SVG is assembled as a string and saved through a blob URL. No server sees the drawing, because there is no server in this path — the only request the tool makes is for its own JavaScript chunk from toolchamp.app, which happens once when the page loads and carries no part of your file. Nothing is stored: no localStorage, no IndexedDB, no cache entry. Reload the tab and the drawing, the layer list and the generated SVG are all gone.

About this tool

  1. 1

    Drop the DXF

    Drag the file onto the box or click to browse. It is parsed immediately and the stats row shows the entity count, the layer count, the declared unit and the drawing extents.

  2. 2

    Check what was not drawn

    If a warning strip appears it names each skipped entity type with a count and a reason — hatches, dimensions and ACIS solids being the usual three.

  3. 3

    Hide the layers you do not want

    Click a layer chip to drop it from the preview and from the SVG. Dimension and annotation layers usually go here when the SVG is headed for a cutter.

  4. 4

    Choose real size or a pixel width

    Real size writes width="…mm" so the SVG imports at true scale. Fit to width writes plain user units and is what you want when the SVG is going onto a web page.

  5. 5

    Set the stroke and the colour

    0.25 mm is a hairline. Switch the colour mode to black only when the SVG is going to a cutter that maps colour to power.

  6. 6

    Download the SVG

    The file is assembled in the tab and saved by the browser. The success banner reports its byte size and its finished dimensions.

Specs & compatibility
InputASCII DXF up to 20 MB — binary DXF and DWG are detected and refused with an explanation
OutputSVG 1.1 with the Inkscape namespace declared for layer labels
Size modesreal size (millimetres from $INSUNITS, or bare user units when the file is unitless) or a fixed pixel width from 200 to 4000
Output conformanceplain SVG 1.1 — stroked paths, text and groups, with no CSS, no embedded fonts, no filters and no clip paths, which is the subset every vector editor implements
Fillnone — every path is stroked, which is what a CAD drawing is; closed contours are not filled
Fontstext is written with a Helvetica/Arial fallback stack, not the SHX or TrueType font named in the DXF, because a DXF references fonts and does not embed them
Layers hidden before exportexcluded from the SVG entirely, not written with display:none
Browser supportChrome, Edge, Firefox, Safari and Opera, current versions
Offlineworks with no network once the page has loaded
  • Open the result in Inkscape and you will find your CAD layers in the Layers dialog — that is what the inkscape:groupmode attribute buys, and it makes selecting a whole layer one click instead of a rubber-band.
  • If the SVG is huge, look at the spline count. Each SPLINE is sampled to 64 segments by default, and a drawing made of splines produces far more path data than one made of arcs.
  • A drawing exported at real size will look tiny in a browser tab because the browser renders 1 mm as about 3.8 px. That is correct behaviour, not a scaling bug — import it into a vector editor to see it at size.
  • Text is drawn with a web font, so a title block will not line up glyph-for-glyph with the CAD. If the letters have to be cut rather than read, explode them to geometry in CAD before exporting.
  • For a cutting file, hide every layer except the profile and switch the colour to black — you get a single-colour SVG with one group, which is the simplest thing a cutter driver can be handed.
  • Very long drawings export faster than they preview: the canvas has to rasterise, the SVG is just string building.
  • One SVG group per CAD layer, labelled for Inkscape
  • Real millimetre width and height from $INSUNITS
  • Arcs, circles, ellipses and polyline bulges kept as curves
  • Blocks expanded, including rotated and scaled rectangular arrays
  • TEXT and MTEXT as editable SVG text with the right alignment
  • Per-layer visibility applied to the exported file, not just the preview
  • Bringing a machinist's DXF into Inkscape or Illustrator to add artwork around it.
  • Putting a CAD drawing on a web page as crisp vector rather than a screenshot.
  • Feeding a laser cutter whose software takes SVG but chokes on the DXF dialect your CAD writes.
  • Making a clean single-colour outline from a drawing that arrived with a dozen annotation layers.
  • Getting geometry out of a DXF for a plotter, a vinyl cutter or an embroidery program that speaks SVG.
  • Checking a supplier's drawing on a tablet without installing a CAD viewer.
Yes, provided the DXF says what its numbers mean. The header field $INSUNITS carries a code from 0 to 20 — 1 is inches, 4 is millimetres, 6 is metres — and the exporter converts to millimetres and writes them into the width and height attributes. Import that SVG into Inkscape or Illustrator and a 120 mm part measures 120 mm. If $INSUNITS is 0 the file is genuinely unitless, the page shows a warning, and the SVG is written in bare user units for you to scale yourself.
Because many converters flatten arcs into line segments to keep the code simple. This one converts each arc into cubic Bézier segments spanning at most 90 degrees, using the standard 4/3·tan(Δ/4) control-point construction. The maximum radial deviation of that approximation is under 0.0003 of the radius, which on a 50 mm arc is 15 microns — below what any cutter or printer resolves, and the curve stays a curve when you zoom or edit it.
They are counted and named in a warning strip, and not drawn. A HATCH stores a boundary plus a named pattern definition rather than the lines you see, and a DIMENSION stores reference points and a style name rather than its arrowheads and text. Reconstructing either means reimplementing part of a CAD application and guessing at style tables that may not be in the file. Exploding them in your CAD turns both into ordinary lines and text, which this converter does draw.
Yes. TEXT and MTEXT become real SVG text elements with text-anchor and dominant-baseline derived from the DXF alignment codes, so they are selectable and editable in any vector editor. What does not carry over is the typeface: a DXF names a font — often an SHX shape file — and does not embed it, so the SVG uses a Helvetica and Arial fallback stack. Letter positions will therefore differ slightly from the CAD rendering.
They are expanded in place. Every INSERT is resolved against the block definition and its transform — insertion point, X and Y scale, rotation, and the row and column spacing of a rectangular array — is applied to the geometry. Because that transform is affine, control points map exactly, so a circle inside a block scaled twice in X comes out as a true ellipse rather than a squashed polygon. Nested blocks are followed up to eight levels, which stops a self-referencing block from looping forever.
No. The parser, the geometry code and the SVG writer are all JavaScript that arrived with the page, and they run on the bytes the File API reads from your disk. There is no server endpoint behind this tool at all. Turn the network off after the page loads and the conversion still works, which is the simplest way to prove it to yourself.
View all

Updated

We use anonymous analytics to improve ToolChamp. No personal data is stored or sold. Privacy Policy