Format guide · 6 minute read
What Is a DXF File?
A DXF file is a CAD drawing written out as text so that any program can read it. It is how drawings travel between CAD packages, into laser cutters and CNC machines, and out of survey and design software. Here is what is inside one, how to open it, and when it is the right format.
DXF in two sentences
DXF — Drawing Exchange Format — was published in 1982 alongside the first release of the industry standard CAD program, as a documented, text-based twin of its binary DWG file, so that other software could read a drawing without decoding the binary. Four decades later it is still the lingua franca of 2D CAD: every drafting program, every cutting machine’s software and most illustration and GIS tools can read or write it.
Unlike DWG, the DXF specification is published, which is why support for it is so wide and so consistent. It has versions that track the DWG releases, but in practice one of them — R2000, version word AC1015 — is what nearly everything exports, because it holds every 2D feature that matters and every reader accepts it.
How a DXF file is laid out
Open a .dxf file in a text editor and you see pairs of lines, all the way down: a group code on one line and a value on the next. Code 0 starts a new item and names its type; 8 is the layer; 10, 20 and 30 are an X, Y and Z coordinate; 62 is a colour number. A line from the origin to (100, 50) on layer WALLS reads, in part:
0 LINE 8 WALLS 10 0.0 20 0.0 11 100.0 21 50.0
The pairs are organised into sections, each opened by 0 / SECTION and a name, and the file ends with 0 / EOF:
| Section | What it holds |
|---|---|
| HEADER | The drawing's variables: $ACADVER (the version), $INSUNITS (the units), extents, limits, the linetype scale — some 250 of them. |
| CLASSES | Definitions of the object types the file uses beyond the built-in ones; often empty in exports. |
| TABLES | Layers, linetypes, text styles, dimension styles, views, viewports and coordinate systems, each as a table of records. |
| BLOCKS | Every block definition, including model space and the paper-space layouts, with the entities that make it up. |
| ENTITIES | The drawing itself: every line, polyline, arc, circle, text, hatch, dimension and block insert in model and paper space. |
| OBJECTS | Non-graphical objects: dictionaries, layouts, groups, plot settings, table and multileader styles. |
The design is deliberately simple to parse and deliberately forgiving: a reader can skip a group code it does not understand and keep going, which is how a 1995 program can open a file that carries 2018 entity types it has never heard of — it draws what it knows and ignores the rest.
ASCII and binary DXF
The DXF you meet is almost always ASCII: plain text, readable, diffable, easy to generate from a script — and large, since a coordinate is spelled out in digits. A binary DXF variant exists, opening with a 22-byte sentinel and storing the same group codes and values as bytes; it is about a quarter smaller and faster to read, and considerably less common. Both are recognised automatically by the viewer and converters on this site. Note that binary DXF is not DWG: it is DXF’s structure in a compact spelling, not the native format.
What a DXF contains — and what it does not
Everything a 2D drawing is made of: geometry (LINE, LWPOLYLINE, POLYLINE, CIRCLE, ARC, ELLIPSE, SPLINE, POINT, SOLID), annotation (TEXT, MTEXT, DIMENSION, LEADER, HATCH), structure (layers, blocks and INSERTs, linetypes, text and dimension styles, layouts) and the header variables that give the numbers meaning — above all $INSUNITS, which says whether 100 means millimetres, inches or nothing in particular.
What it carries poorly: 3D solids, which are stored as opaque modelling-kernel data; embedded images, which it references by path rather than containing; and the proprietary objects of vertical applications, kept as opaque proxies. For flat drawings — the vast majority of what DXF is used for — nothing is lost.
Which programs read DXF files
| Who | How |
|---|---|
| CAD programs | Every one of them, free or paid, 2D or 3D, on every platform — DXF is the format they all agree on. |
| Laser, plasma, router, vinyl cutters | LightBurn, VCarve, SheetCam and the software that ships with the machines read DXF as their main input. |
| Open-source design tools | LibreCAD and QCAD open it natively; FreeCAD and Inkscape import it; Blender imports it through an add-on. |
| GIS, survey and mapping | Coordinates in DXF are plain numbers, so survey software exports it and GIS packages import it. |
| 3D modellers | SolidWorks, Onshape and their peers import DXF sketches to extrude or cut from. |
| A text editor | It is text. You can open a DXF in Notepad and read the layer names, or write one from a script. |
Typical sizes
A cut file for a laser: 20 to 500 KB. A floor plan exported from CAD: 1 to 10 MB. A survey or a map with many contours: 20 to 100 MB. As a rule a DXF is three to five times the size of the same drawing as DWG, and it compresses extremely well — a zipped DXF is usually smaller than the DWG.
When DXF is the right choice
When the receiving program is not a CAD program, or is a different one from yours: cutters, GIS, illustration tools, open-source CAD, a script. When you want a file that will still be readable in thirty years. When a client says “send me the CAD file” and you do not know what they use. When a file needs to be inspected or repaired by hand. For working inside one CAD program, day to day, the native DWG is smaller and faster; the DWG vs DXF guide weighs the two properly.
How to open, convert or make a DXF
Open: drop it on the viewer below — in the browser, no upload, full CAD. Convert to DXF: from a DWG with DWG to DXF; from an SVG, PNG or JPG with the image tracers — SVG to DXF, PNG to DXF. Convert from DXF: to DWG, PDF or SVG. Download ready-made ones: the free DXF files in the block library.