DXF files, and how to convert them
DXF is the drawing a laser cutter, a waterjet, a plasma table or a CNC router is actually given. It is also the most misunderstood format on this site, because what is inside a DXF is almost never what people expect: not shapes, but the loose pieces shapes were drawn with.
.dxf · image/vnd.dxf
DXF conversions that work today
Convert a DXF file into something else
Make a DXF file from something else
DXF guides
A DXF is a bag of pieces, not a set of shapes
This one fact explains most of the trouble people have with DXF. A rectangle with rounded corners, saved out of AutoCAD, is four LINE entities and four ARC entities, stored in no particular order, none of them knowing about the others. Drawn on screen they form one closed outline. In the file there is no outline at all.
Anything that needs an area — giving a drawing a thickness, filling it, cutting it out as a shape — has to join those pieces back up first. Tools that skip that step read the file, find nothing already closed, and report an empty drawing. That is the single most common reason a free DXF converter hands back nothing, and it is almost never a problem with the file.
The converters here do the joining: they walk the ends of every line and arc, find the ones that meet, and rebuild the loops. How many had to be rebuilt is reported under the 3D view, because when something does go wrong that number is where it shows.
The unit field, and the mistake that wastes material
A DXF can state what one drawing unit means, in a header field called $INSUNITS. Plenty of files do. Plenty do not, and a drawing from an American shop is very often in inches whether it says so or not.
There is no way for any tool to be certain. So the honest thing is to read the field when it is there, say so plainly, and put the measured width and depth in front of you before anything is written. A 300 mm panel showing as 11.8 mm was drawn in inches and said nothing; the scale box fixes it in one step.
This matters more here than anywhere else on this site. A 3D print that comes out the wrong size costs an hour and some filament. A sheet of 3 mm acrylic cut to the wrong size is gone.
Bulges, blocks and splines
Three things in a DXF carry geometry that a naive reader misses, and all three are common in real drawings.
A bulge is one number on a polyline vertex that turns the following straight segment into an arc. Every rounded corner, slot and fillet in a machining drawing is stored this way. Ignore it and a slot becomes a rectangle.
A block is a group of entities defined once and placed many times by an INSERT entity. A plate with twenty identical holes is usually one block placed twenty times, so a reader that walks only the main entity list sees a plate with no holes.
A spline is a NURBS curve with a knot vector. Anything traced or drawn freehand arrives as one, and the usual shortcut of joining up the control points visibly cuts the corners off every curve in the drawing.
DXF and DWG are not the same thing, and only one of them is open
DWG is AutoCAD’s own file format. It is closed, and reading or writing it legally means a paid membership of the Open Design Alliance. No free tool can do it, and any web tool claiming to is either using a paid licence or doing something it should not.
DXF was published by Autodesk precisely so that other programs could exchange drawings with AutoCAD. It is a documented text format, and every program that opens a DWG also opens a DXF.
So when a shop asks for a DWG, a DXF is very nearly always accepted, and it is the only one of the two that a browser can produce. The files written here are R12 — the oldest and most widely readable version — because the controller on a cutting machine is frequently older than the part being cut.
What a DXF cannot carry
Depth. It is a 2D drawing format, and although it has some 3D entities almost nothing writes real 3D geometry into one. A model that needs to stay 3D should be a STEP file or an STL.
A font. Text in a DXF is a request to draw letters in a typeface that is not in the file, so lettering has to be exploded to outlines before it means anything to a cutting machine.
A guarantee of scale, as above. The unit field is optional and frequently left at whatever the template had.
What DXF cannot store
- Real 3D geometry, in any practical sense — it is a drawing format
- The font that its text is written in
- Any guarantee about what one drawing unit means
- Material, thickness or cutting parameters
DXF in detail
| Property | DXF.dxf |
|---|---|
| File contents | Plain text in numbered group codes, with a binary variant nobody uses. |
| Geometry | Lines, arcs, circles, polylines and splines, in 2D and limited 3D. |
| Units | Recorded in a header variable, as one of twenty-odd unit codes. |
| Colour and texture | A colour number per entity, and colour by layer. |
| Separate objects | Named layers, plus blocks for repeated geometry. |
| Published by | Autodesk, 1982, as the published counterpart to the closed DWG. |
| Written by | AutoCAD, LibreCAD, QCAD, Fusion 360 and every laser cutter’s software. |
Questions
- Why does my DXF come out empty in other converters?
- Because the outlines in it are stored as loose lines and arcs rather than as closed paths, and the other tool did not join them up. The converters here do. If a shape has a genuine gap in it — trimmed lines that do not quite meet — it still cannot be closed, and the message under the 3D view says how many were left out for that reason.
- Can you read DWG?
- No, and nothing free can. Every CAD program that opens a DWG can save it as a DXF, which takes about five seconds and gives you a file that works everywhere.
- Which DXF version do you write?
- R12, with the units in the header and one layer. It is the version every machine controller and CAM program reads. The newer versions add object handles and a class table, which carry no geometry and are the usual reason an older importer rejects a file.
- Is my drawing uploaded?
- No. It is read by your own browser. For commercial machining work that is usually the point, and it is also why there is no file size limit.