Open DWG file
Home › CAD file formats explained › What is a DXF file?

What is a DXF file?

A DXF file (Drawing Exchange Format) is a CAD drawing stored as a documented, mostly plain-text list of group codes so that any program can read it, not only AutoCAD. Autodesk introduced it in 1982 alongside DWG and still publishes the specification. You can open a .dxf file right here in the browser, ASCII or binary, any version.

DXF file format: who uses it and why

DXF exists because DWG is closed. When AutoCAD needs to hand a drawing to another program, or another program needs to hand one to AutoCAD, DXF is the neutral format both sides understand. That is why you meet .dxf files far outside the CAD office: laser and plasma cutters, CNC routers, vinyl cutters such as Cricut and Silhouette, embroidery software, GIS packages, Inkscape and Illustrator all import or export DXF.

A DXF holds the same things a DWG file holds: layers, linetypes, blocks, text, dimensions and the entities themselves. What it does not hold is anything AutoCAD treats as a proprietary custom object (for example Civil 3D surfaces), which is written as a proxy or dropped.

Check the file in the viewerDrop a DWG or DXF here to open it. Nothing is uploaded.DWG R14–2018+, DXF ASCII or binary, up to 60 MB. Private: the file stays in this browser tab.

How a DXF is structured: group codes

An ASCII DXF is a sequence of pairs: a line with a group code (an integer that says what the next value means) and a line with the value. Code 0 starts a new entity or section, code 8 is the layer name, codes 10/20/30 are the X/Y/Z of a start point, 11/21/31 the end point, 62 the color index. A line from (0,0) to (100,50) on layer WALLS looks like this:

0 / LINE / 8 / WALLS / 10 / 0.0 / 20 / 0.0 / 11 / 100.0 / 21 / 50.0 (each value on its own line)

The file is divided into sections in a fixed order: HEADER (drawing variables such as $ACADVER, the version), CLASSES, TABLES (layers, styles, viewports), BLOCKS, ENTITIES (the geometry), OBJECTS (dictionaries, layouts) and an optional THUMBNAILIMAGE, closed by 0 / EOF. Because it is text, you can open a DXF in a text editor, search for a layer name, or generate one from a script. The price is size: an ASCII DXF is typically several times larger than the DWG it came from. Binary DXF packs the same group codes in binary and is about a quarter of the ASCII size, but far fewer programs read it.

DXF versions

Every DXF carries the AutoCAD version it was written for in the $ACADVER header variable, using the same codes as DWG: AC1009 for R12, AC1014 for R14, AC1015 for 2000, AC1018 for 2004, AC1021 for 2007, AC1024 for 2010, AC1027 for 2013 and AC1032 for 2018 and later. R12 DXF is the lowest common denominator: it has no lightweight polylines, no MTEXT and no true splines, so it is what most cutting machines and older tools ask for. If a program refuses your file, saving it as "AutoCAD R12/LT2 DXF" usually fixes it. Details are on the DXF versions page.

How to open a DXF file

Drop the file into the viewer above. It reads ASCII and binary DXF of any AutoCAD version and renders it with WebGL: pan, zoom, fit, layers on and off, a measure tool, print, and PNG/SVG/PDF export, all without uploading anything. If you mostly work with DXF, the sister site dxfviewer.app runs the same engine, and the Chrome extension "DXF Viewer" opens .dxf links directly from a web page.

On the desktop, LibreCAD and QCAD (free, Windows/macOS/Linux) open and edit DXF; Inkscape imports R12/R14 DXF as vector paths; AutoCAD and BricsCAD open any version. See how to open a DXF file for the steps and edit DXF online if you need to change it.

How to convert DXF files

Out of DXF: the viewer exports DXF to PDF (vector), DXF to SVG and DXF to PNG directly. DXF to DWG needs a program that writes DWG, such as AutoCAD, DWG TrueView or the free ODA File Converter; this viewer never writes DWG.

Into DXF: images are the common request. JPG to DXF and PNG to DXF mean tracing pixels into vectors (Inkscape's Trace Bitmap, then Save As DXF), which works for clean logos and fails for photos. SVG to DXF is a true vector-to-vector conversion and keeps the shapes exact. PDF to DXF works for vector PDFs only.

Is DXF 2D or 3D, and is it a vector file?

DXF is a vector format: it stores lines, arcs and curves with coordinates, not pixels, so it scales without loss. It can be 2D or 3D. Every point has a Z coordinate, and entities such as 3DFACE, POLYFACE mesh and (in newer versions) 3DSOLID exist, so a 3D model can be saved as DXF. In practice most DXF files in circulation are 2D, because the main consumers (cutters, 2D CAD, GIS) only use X and Y. For 3D printing, STL to DXF flattens triangles into 3DFACE entities, which is rarely what you want; keep STL or STEP for solids.

Frequently asked questions

What is a DXF file format?

DXF is Autodesk's Drawing Exchange Format: a CAD drawing written as pairs of group codes and values in a documented layout, so any program can read or write it. It exists in ASCII (text) and binary variants.

Is DXF a CAD file?

Yes. A DXF contains the same CAD data as a DWG (layers, blocks, lines, arcs, text, dimensions) in an open text structure instead of AutoCAD's closed binary one.

Can DXF files be 3D?

Yes. DXF coordinates include Z, and 3DFACE, mesh and 3DSOLID entities can be stored. Most DXF files you meet are 2D because cutters and 2D CAD programs only read X and Y.

Is DXF a vector file?

Yes. DXF describes geometry with coordinates, so it scales without pixelation. Converting a JPG or PNG to DXF requires tracing the image into vectors first.

What are .dxf files used for?

Exchanging drawings between CAD programs, sending shapes to laser, plasma, CNC and vinyl cutters, importing CAD outlines into GIS or Illustrator, and scripting drawings from code.

What is the difference between DXF and DWG?

DWG is AutoCAD's compact, closed binary format; DXF is the open, larger exchange version of the same drawing. See DXF vs DWG.