What is a DXF file?
A DXF file (Drawing Exchange Format) is Autodesk's open text format for exchanging CAD drawings. It lists the lines, arcs, circles and polylines of a drawing with their layers, and is the format laser cutters, CNC routers and plotters most commonly accept.
| File extension | .dxf |
|---|---|
| Type | 2D / 3D drawing exchange (text) |
| Developed by | Autodesk |
| First released | 1982, with AutoCAD 1.0 |
| Encoding | ASCII text of code/value pairs (a rare binary variant exists) |
| Colour / materials | Yes – per layer or per entity, by colour index |
| Units | Optional header value ($INSUNITS); often missing |
| Exact CAD geometry | Yes for lines, arcs and splines in 2D |
| MIME type | image/vnd.dxf |
| Opens in 3dfiles | Yes – DXF viewer |
About the DXF format
Autodesk introduced DXF in 1982 so that other programs could read AutoCAD drawings without the closed DWG format. Because its specification is published, almost every CAD, CAM and vector program reads and writes it: AutoCAD, Fusion, SolidWorks, FreeCAD, LibreCAD, Inkscape and Illustrator among them.
In practice DXF is used for flat geometry: profiles for laser and plasma cutting, CNC routing paths, sheet-metal flat patterns and floor plans. It can describe 3D solids too, but programs rarely exchange 3D through it; STEP does that job.
What a DXF file looks like inside
DXF (group code on one line, value on the next)
0
SECTION
2
ENTITIES
0
LINE
8
Outline
10
0.0
20
0.0
11
80.0
21
0.0
0
CIRCLE
8
Holes
10
20.0
20
25.0
40
8.0
0
ENDSEC
0
EOFEvery value is preceded by a numeric code that says what it is: 0 starts an entity, 8 is the layer, 10/20 are X and Y of the first point, 40 is a radius. That is why a DXF is long but easy to read.
How to open a DXF file
- Open it in the DXF viewer: layers, size and units are shown.
- Free desktop: LibreCAD, QCAD, FreeCAD, Inkscape; Autodesk's free DWG TrueView on Windows.
- Make a 3D part from it with DXF to STL, or get a DXF outline from a model with STL to DXF.
Common problems
The drawing is 25.4 times too small or too big
The file has no unit, or the receiving program ignores it. A drawing made in inches read as millimetres is 25.4 times too small. Set the unit when opening or scale the result.
Shapes will not fill or extrude
The outline is not closed: two ends that look joined are slightly apart. Join the segments into one closed polyline before exporting.
Curves arrive as hundreds of short lines
Some exporters convert splines to line segments. Export splines or arcs where the option exists, or accept the faceting if the tolerance is fine enough.
Questions about DXF files
Is DXF the same as DWG?
No. DWG is AutoCAD's closed native format; DXF is the open exchange format carrying much the same drawing data as readable text.
Can a DXF be 3D printed?
Not directly, because it is a flat drawing. Extrude its closed outlines to a thickness first; the result is an STL a slicer accepts.