What Is DXF?
DXF stands for Drawing Exchange Format (also called Drawing Interchange Format), an open file format developed by Autodesk in 1982 alongside the original release of AutoCAD. DXF was designed to enable data interoperability between AutoCAD and other CAD programs — at a time when each vendor used proprietary binary formats that were incompatible with each other.
DXF files can be either plain text (ASCII) or binary. The ASCII version is the most common: it is human-readable, directly inspectable with a text editor, and can be produced by any programming language without binary format knowledge. The binary version offers smaller file sizes and faster parsing.
DXF has become the de facto interchange standard for 2D CAD drawings. Nearly every CAD application (AutoCAD, DraftSight, LibreCAD, QCAD, SolidWorks 2D, Inkscape, CorelDRAW with plugins) can import and export DXF. It is also widely used in CNC (Computer Numerical Control) machining, laser cutting, vinyl cutting, and waterjet cutting as the standard input format for machine controllers.
File Structure: Groups and Codes
DXF uses a remarkably simple text format based on group code / value pairs:
0
SECTION
2
HEADER
9
$ACADVER
1
AC1027
...
0
ENDSEC
0
SECTION
2
ENTITIES
0
LINE
8
0
10
100.0
20
200.0
30
0.0
11
300.0
21
400.0
31
0.0
0
ENDSEC
0
EOF
Each entry is a group code (integer on its own line) followed by a value (on the next line). Group codes indicate the type of data:
| Group code range | Meaning |
|---|---|
| 0 | Entity type or special marker (SECTION, ENDSEC, EOF) |
| 1-9 | String values (names, text content) |
| 10-19 | X coordinates |
| 20-29 | Y coordinates |
| 30-39 | Z coordinates |
| 40-49 | Floating-point values (radius, angles) |
| 50-59 | Angles (degrees) |
| 60-69 | Integer values |
| 70-79 | Integer flags |
| 210-239 | Extrusion direction vectors |
DXF Sections
A DXF file is organised into sections:
HEADER — Global variables for the drawing:
$ACADVER— AutoCAD version (AC1027 = AutoCAD 2013)$INSUNITS— Drawing units (1=inches, 4=mm, 6=meters)$MEASUREMENT— English (0) or Metric (1) units$EXTMIN,$EXTMAX— drawing extents (bounding box)$DWGCODEPAGE— text encoding (ANSI_1252, UTF-8)
CLASSES — Custom class definitions (DXF R14 and later)
TABLES — Named objects used throughout the drawing:
LTYPEtable — line type definitions (solid, dashed, dotted, centre)LAYERtable — layer names, colours, line types, visibilitySTYLEtable — text style definitions (font, height, width factor)VIEWtable — named viewsDIMSTYLEtable — dimension style definitionsBLOCK_RECORDtable — references to block definitions
BLOCKS — Block definitions (reusable symbol libraries):
BLOCK
2
DOOR_SYMBOL
10
0.0
20
0.0
...drawing entities for the block...
ENDBLK
ENTITIES — The actual drawing content:
- LINE — straight line between two points
- ARC — circular arc (centre, radius, start/end angles)
- CIRCLE — complete circle (centre, radius)
- ELLIPSE — ellipse (centre, major axis, ratio)
- LWPOLYLINE — lightweight polyline (closed or open sequence of 2D points)
- POLYLINE — 3D polyline
- SPLINE — NURBS (Non-Uniform Rational B-Spline) curve
- TEXT / MTEXT — single-line and multi-line text
- DIMENSION — dimension annotation
- HATCH — filled pattern (cross-hatch, solid fill)
- INSERT — reference to a block definition at a location
- VIEWPORT — paper space viewport
- SOLID — filled quadrilateral
- POINT — a single point
- IMAGE — raster image reference
- ATTDEF / ATTRIB — attribute definition and value
OBJECTS — Non-graphical data (dictionaries, groups, xrecords — DXF R13+)
THUMBNAILIMAGE — Optional embedded preview image (DXF R2000+)
Layers
Layers are fundamental to CAD drawings. Each entity belongs to a layer (defaulting to layer "0"). The LAYER table defines:
- Name — arbitrary string identifier
- Color — ACI (AutoCAD Color Index, 1-255) or true color
- Linetype — solid, dashed, centre, hidden, etc.
- On/Off — visibility
- Frozen/Thawed — excluded from regeneration
- Locked — prevents modification
- Plotted/Not plotted — printing control
CNC and laser cutting workflows typically use layers to distinguish cut paths, engrave paths, and mark-only paths, with the machine controller interpreting each layer differently.
DXF vs. DWG
DWG is AutoCAD's native binary format. DXF is the open exchange format derived from DWG:
| Aspect | DXF | DWG |
|---|---|---|
| Open specification | Yes (published by Autodesk) | No (binary, documented unofficially by OpenDesign) |
| Human-readable | Yes (ASCII version) | No |
| File size | Larger (ASCII text) | Smaller (binary) |
| Compatibility | Universal | Primarily AutoCAD |
| Features | Subset of DWG | Full AutoCAD feature set |
| Raster images | Referenced externally | Can be embedded |
| 3D support | Limited | Full |
Most DXF limitations compared to DWG involve complex 3D objects, materials, rendering properties, and advanced annotation that have no DXF equivalent.
DXF in CNC and Laser Cutting
DXF is the universal input format for CNC controllers, laser cutters, vinyl cutters, and waterjet systems. Workflow:
- Design geometry in CAD software → export as DXF
- Import DXF into CAM software (Fusion 360, Mastercam, RDWorks, LightBurn)
- CAM software generates toolpaths from DXF geometry
- Toolpaths are exported as G-code or machine-specific format
- Machine controller executes G-code
Critical requirements for CNC/laser DXF:
- Closed polylines — cut paths must be fully closed (no gaps)
- Correct units — match the DXF INSUNITS to the machine's expected units
- No overlapping geometry — duplicate lines cause double-cuts
- Explode blocks — some controllers cannot read INSERT references; explode to primitives
- Flat geometry — most 2D cutters ignore Z coordinates; ensure geometry is at Z=0
DXF Versions
DXF has gone through many versions tied to AutoCAD releases:
| DXF version | AutoCAD version | Notable additions |
|---|---|---|
| AC1006 | AutoCAD 10 | First public version |
| AC1009 | AutoCAD 12 | Widely compatible baseline |
| AC1012 | AutoCAD 13 | ELLIPSE, SPLINE, LEADER |
| AC1014 | AutoCAD 14 | True color, LAYOUT |
| AC1015 | AutoCAD 2000 | Embedded raster images |
| AC1018 | AutoCAD 2004 | Object reactors, ATTDEF improvements |
| AC1021 | AutoCAD 2007 | 3D solid improvements |
| AC1027 | AutoCAD 2013 | Current widely-used version |
| AC1032 | AutoCAD 2018 | Proxy graphics improvements |
For maximum compatibility with older CAD tools and CNC controllers, export as AC1009 (AutoCAD R12). For full feature fidelity, use AC1027 or newer.
Converting DXF
DXF → SVG: For web display or design software. DXF geometry maps well to SVG paths; text, dimensions, and hatches may need post-processing. Tools: Inkscape (File → Import), ezdxf (Python library), online converters.
DXF → PDF: For documentation and sharing. Most CAD applications export directly. Include all layers or specified layers.
DXF → DWG: AutoCAD or compatible applications handle this. LibreCAD and QCAD (open-source) also convert between DXF and DWG.
DXF → G-code: Via CAM software (not a direct conversion; requires toolpath parameters).
SVG → DXF: Inkscape can save as DXF. Complex SVG features (filters, gradients) are lost.
PDF → DXF: Limited; PDF graphics can be vector-based, but extracting clean DXF requires tracing. Tools: Adobe Illustrator with DXF export, Inkscape, pdf2dxf utilities.
Summary
DXF is one of the oldest and most successful open CAD interchange formats, having enabled cross-software CAD collaboration for four decades. Its ASCII text structure makes it uniquely transparent and programmable — DXF files can be read, written, and processed by any programming language with basic file I/O. Its layer system, entity types, and block references provide sufficient expressiveness for 2D technical drawing. While DWG offers richer features and smaller files, DXF remains the universal lingua franca of 2D CAD interchange, indispensable in manufacturing, architecture, GIS, laser cutting, and CNC machining.
Related conversions
Frequent conversions across the catalogue: