NASJI

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:

The sections of a DXF file
SectionWhat it holds
HEADERThe drawing's variables: $ACADVER (the version), $INSUNITS (the units), extents, limits, the linetype scale — some 250 of them.
CLASSESDefinitions of the object types the file uses beyond the built-in ones; often empty in exports.
TABLESLayers, linetypes, text styles, dimension styles, views, viewports and coordinate systems, each as a table of records.
BLOCKSEvery block definition, including model space and the paper-space layouts, with the entities that make it up.
ENTITIESThe drawing itself: every line, polyline, arc, circle, text, hatch, dimension and block insert in model and paper space.
OBJECTSNon-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

Programs that read DXF
WhoHow
CAD programsEvery one of them, free or paid, 2D or 3D, on every platform — DXF is the format they all agree on.
Laser, plasma, router, vinyl cuttersLightBurn, VCarve, SheetCam and the software that ships with the machines read DXF as their main input.
Open-source design toolsLibreCAD and QCAD open it natively; FreeCAD and Inkscape import it; Blender imports it through an add-on.
GIS, survey and mappingCoordinates in DXF are plain numbers, so survey software exports it and GIS packages import it.
3D modellersSolidWorks, Onshape and their peers import DXF sketches to extrude or cut from.
A text editorIt 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.

Try it: open a DXF in your browser

Go to the DXF viewer Measure, check layers, edit and save — free.

DXF files — frequently asked questions

What does DXF stand for?

Drawing Exchange Format (sometimes written Drawing Interchange Format). The name says its purpose: it exists to move a drawing between programs that do not share a native format. It was introduced in 1982, the same year as DWG, and has tracked DWG's content ever since.

Is DXF a 2D or 3D format?

Both, but it is used overwhelmingly for 2D. Every entity has three coordinates and DXF can hold 3D faces, meshes and polylines with elevation; solid models, however, are stored as opaque data most programs cannot read back. For flat work — plans, parts, cut paths, signs — it is complete.

How do I open a DXF file for free?

Drop it on the viewer on this page: it opens in your browser without an upload, in a full CAD, so you can measure and edit as well as look. On a phone, the same page works in touch mode. For a desktop program, LibreCAD and QCAD are free and open DXF natively, and the NASJI desktop app opens DXF and DWG on Windows and macOS.

Why is my DXF so much larger than the DWG it came from?

Because it is text, and text is verbose: each value occupies two lines, a group code and the value, and a coordinate is written out as decimal digits rather than eight binary bytes. Three to five times the DWG's size is normal. Binary DXF is about a quarter smaller; compressing the file with zip brings it well under the DWG.

Which DXF version should I export for a laser cutter or CNC?

R2000 (AC1015) ASCII, unless the machine's software says otherwise. It holds everything a cut file needs — layers, polylines with arcs, circles, text — and every cutting program from the last twenty years reads it. Some very old controllers want R12; the CAD's Save As offers that.