DXF — Complete Guide: 1982-2026 History, 7 File Sections, Group Codes, How to Export from OpenStreetMap
DXF stands for Drawing Exchange Format. It's an open CAD format that Autodesk released alongside AutoCAD 1.0 in December 1982, and it has since become the universal language for exchanging vector drawings between programs from different vendors. The text-based nature of the file makes it human-readable, easy to parse with scripts, and compatible with virtually any CAD software — from $1690/year AutoCAD to free LibreCAD on Linux. This article covers what's missing from our short DXF vs DWG comparison: the full version timeline, a breakdown of the seven internal sections, group codes, five real-world roles with workflows, and a step-by-step recipe for getting DXF from OpenStreetMap.
History 1982-2026
DXF history actually predates Autodesk. Around 1977, programmer Mike Riddle wrote a CAD program called Interact CAD for MicroData and Marinchip machines — an early DOS-era development that Autodesk licensed in 1982. In December that year, Autodesk released AutoCAD 1.0 for the IBM PC, and with it came DXF — a format for exchanging drawings between AutoCAD and third-party programs. Initially it was pure text ASCII; no binary alternative existed.
Key version timeline:
- 1982: AutoCAD 1.0, DXF appears as ASCII-only exchange format.
- 1988: AutoCAD R10 — binary DXF variant added (extension
.dxb). - 1992: AutoCAD R12 — expanded 3D primitives support.
- 1994: AutoCAD R13 — revolutionary spec expansion: CLASSES and OBJECTS sections added, custom application objects became possible.
- 2000: AutoCAD 2000 → DXF version code AC1015 — reworked entity handle structure, multilines and lwpolyline appeared.
- 2004: AutoCAD 2004 → AC1018, dynamic blocks added.
- 2007: AutoCAD 2007 → AC1021 — critical transition: encoding changed from local codepage (CP1251 for the Russian version, etc.) to UTF-8. This solved the "mojibake" problem when transferring files between Russia, Germany, and Japan.
- 2010: AutoCAD 2010 → AC1024.
- 2013: AutoCAD 2013 → AC1027.
- 2018: AutoCAD 2018 → AC1032 — current stable spec version, still used in AutoCAD 2024/2025.
Autodesk publishes the official DXF Reference freely — a decision made in 1982 for the third-party developer ecosystem and maintained since. This openness is what makes DXF a real standard, not just "spec on paper." For contrast: DWG still has no official open specification, and all DWG parsers (including LibreDWG and Open Design Alliance) are based on reverse-engineering.
The Library of Congress Sustainability of Digital Formats catalog rates DXF as "medium" for long-term sustainability — higher than DWG, specifically because of documentation and text format.
Technical — 7 file sections
ASCII DXF is a sequence of "group code → value" pairs. Each value occupies its own line, preceded by a line with a numeric group code. The entire file is divided into seven named sections separated by 0 / SECTION markers.
What's in each section:
- HEADER — global drawing variables:
$ACADVER(version code, e.g.AC1027),$INSBASE,$EXTMIN/$EXTMAX(bbox),$LIMMIN/$LIMMAX(drawing limits), measurement units, current layer. - CLASSES (added in R13/1994) — custom application class definitions for non-core objects.
- TABLES — registries: list of layers (LAYER), text styles, line types, dimension styles, UCS, viewports, block records.
- BLOCKS — block definitions (reusable geometry).
- ENTITIES — the largest section, holding all actually-drawn geometry: LINE, LWPOLYLINE, ARC, CIRCLE, TEXT, INSERT, HATCH, SOLID, 3DFACE, MTEXT, etc.
- OBJECTS (R13+) — non-graphical objects: dictionaries, xrecords, group definitions, layouts.
- EOF — end-of-file marker.
Minimal valid ASCII DXF (LWPOLYLINE with two points on layer Roads):
0
SECTION
2
ENTITIES
0
LWPOLYLINE
8
Roads
90
2
70
0
10
0.0
20
0.0
10
100.0
20
50.0
0
ENDSEC
0
EOF
This is valid DXF — LibreCAD will open it and draw a line from (0, 0) to (100, 50) on the Roads layer.
Group codes — what the numbers mean
Each value line is preceded by a group code — an integer encoding the value type:
- 0 — entity type or structure marker (
SECTION,LWPOLYLINE,ENDSEC,EOF). - 1-9 — text values (names, descriptions).
- 8 — layer name.
- 10, 20, 30 — X, Y, Z of first point (as float).
- 11, 21, 31 — X, Y, Z of second point (for lines).
- 40-59 — other float values (radii, thicknesses, scale).
- 70-78 — integer flags.
- 90-99 — 32-bit integers (e.g. vertex count in LWPOLYLINE).
- 100 — subclass marker (for AutoCAD 2000+).
- 210, 220, 230 — extrusion direction vector (for 3D).
Full reference — in Autodesk DXF Reference Group Codes.
5 use cases by role
1. Architect — 1:2000 master plan basemap
An architect gets a project for a 300×300 m site in central Brest. Before sketching the concept, a precise basemap is needed: buildings, roads, cadastral neighbor boundaries, terrain. Traditionally this meant ordering surveying for $1000-1500 and waiting two weeks.
Now the architect opens osm2cdr.ru, draws a 300×300 m bbox, picks DXF, style standard, CRS WGS 84 / UTM zone 35N. In 25 seconds a 4-12 MB DXF downloads, opens in AutoCAD 2024 or BricsCAD V25 with buildings, roads, and water already on separate layers. The concept gets drawn on this basemap. OSM2CDR doesn't replace surveying for permit documents but is perfect for concept stage and feasibility studies.
2. GIS analyst — bidirectional QGIS ↔ AutoCAD
Standard GIS analyst workflow when working with architects: they're in AutoCAD, I'm in QGIS, exchange via DXF. QGIS imports DXF directly via Layer → Add Layer → Add Vector Layer, preserving layers and group codes. Reverse conversion via Export → Save As → DXF writes a file AutoCAD reads without warnings.
Reverse direction: the GIS analyst prepares the basemap (OSM + cadastral records + satellite), exports to DXF, sends to architect. Cadastral boundaries from public sources can be merged with OSM buildings in QGIS, then handed off as a single DXF.
3. Laser cutting and craft
A woodworking hobbyist makes a decorative city-map panel from 6 mm plywood on a laser cutter. Building and road contours in DXF are the standard for LightBurn, RDWorks, and most laser controllers.
Workflow: open osm2cdr.ru, pick a 1×1 km district, format DXF, style minimal (flat colours, minimal visual noise — ideal as a starting point for laser cleanup), download. Import into LightBurn, delete unused layers (POI icons, excess water grid), assign cut/score/engrave parameters to remaining layers. Fire the laser. Full cycle from bbox to finished panel takes 4-6 hours, of which DXF editing in LightBurn is ~30 minutes.
4. Surveyor — topography and cadastre
A cadastral engineer in Tatarstan prepares a boundary plan. The base drawing comes from a total station as DXF, but context is needed: neighbor parcels, existing buildings, roads, rivers. OpenStreetMap + DXF in MSK-16 projection is a fast way to get this context.
Important note: for Russian cadastre, coordinates must be in the appropriate MSK (local coordinate system) of the federal subject. We support 122 Gauss-Kruger zones keyed to MSK numbers across 85 numbers — an approximation, not the true MSK of a subject; the parameters of 222 real zones across 75 MSK numbers, each with a named source and confidence class, are computed by the coordinate converter. Pick MSK-16 for Tatarstan and the DXF comes out in that Gauss-Kruger zone with no extra transformation. Opens in KOMPAS-3D LT, nanoCAD Cadastre, or AutoCAD without preprocessing.
5. Developer — batch automation via ezdxf
A Python developer automates generation of 200 drawings for a franchise: each location needs a 500×500 m district plan. The script creates a POST /api/render task for each point, waits for it to finish, downloads the DXF, opens it via ezdxf, adds frame, stamp, and logo, saves.
The export is asynchronous: POST /api/render returns a task_id, readiness is polled at GET /api/status/{task_id}, and the file is picked up from GET /api/download/{task_id}/{format}.
import time
import ezdxf
import requests
API = "https://osm2cdr.ru/api"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
for point in franchise_points:
# expand_bbox returns {"min_lon": …, "min_lat": …, "max_lon": …, "max_lat": …}
bbox = expand_bbox(point.lat, point.lon, 500)
task_id = requests.post(f"{API}/render", headers=HEADERS, json={
"bbox": bbox,
"formats": ["dxf"],
"map_style": "standard",
}).json()["task_id"]
while requests.get(f"{API}/status/{task_id}", headers=HEADERS).json()["status"] \
not in ("completed", "failed"):
time.sleep(3)
resp = requests.get(f"{API}/download/{task_id}/dxf", headers=HEADERS)
with open(f"{point.id}.dxf", "wb") as f:
f.write(resp.content)
doc = ezdxf.readfile(f"{point.id}.dxf")
msp = doc.modelspace()
msp.add_text(f"{point.name}", dxfattribs={"layer": "STAMP"})
doc.saveas(f"{point.id}_stamped.dxf")
200 drawings — 40 minutes instead of two days of manual work. More in our batch automation export article.
Software — who opens DXF
AutoCAD (Autodesk) — $1690/year
Native solution. AutoCAD reads and writes any DXF version losslessly, has built-in editor, rendering, 3D, layout/paper space. Single-user subscription — $1690/year retail, free for students and educators via education licensing. If AutoCAD is your main job, there's practically no alternative.
BricsCAD (Bricsys / Hexagon) — $360-960/year
Main commercial AutoCAD clone from Belgium. Full DXF/DWG compatibility, AutoCAD LISP script support, BIM add-on. 3-4x cheaper than AutoCAD: $360/year Lite, $560 Pro, $960 BIM. Runs on Windows, macOS, and Linux — the only full-featured commercial-grade CAD for Linux.
nanoCAD (Nanosoft, Russia) — free / 22,000 RUB/year
Russian CAD from Nanosoft (Moscow). nanoCAD Free is for personal use; paid configurations are 22,000-90,000 RUB/year. Actively used in Russian government and infrastructure projects due to import substitution. Supports Russian regional MSK coordinate systems and Rosreestr cadastral plan templates.
KOMPAS-3D LT (ASCON, Russia) — free
Russian CAD/CAM/CAE from ASCON (Saint Petersburg). LT version is free for education and personal use; commercial KOMPAS-3D V25 starts at 90,000 RUB/year. Strong 3D parametric modeling, widespread in Russian machine-building and engineering universities.
LibreCAD — free, open source (GPL v2)
Fully free 2D CAD for Windows, macOS, Linux. 2D only, but at the level of early AutoCAD versions. Perfect for viewing OSM-derived DXF, editing layers, exporting subsets for laser cutting. 50 MB installer vs 2 GB for AutoCAD. librecad.org.
FreeCAD — free, open source (LGPL v2)
3D parametric modeler with DXF import (via Draft workbench). Less polished than LibreCAD for 2D but gives 3D and BIM (Arch workbench). freecad.org.
QGIS — free, open source (GPL v2)
Not CAD but GIS, yet directly imports DXF as a vector layer preserving layers and attributes. Used for mixed "CAD + GIS" workflow. qgis.org.
Pros / Cons
Pros
- Universal compatibility. Any CAD program from the last 20 years opens DXF, including free ones. De facto exchange standard.
- Text-based — diffable and readable. ASCII DXF opens in Notepad++, lets you see coordinates, compare versions via git diff, write sed scripts for global layer name replacement.
- Open specification. Autodesk has published DXF Reference free since 1982. Removes vendor lock-in risk and ensures archival longevity.
- Layer, block, attribute support. Despite limitations vs DWG, basic CAD functionality (LAYER, BLOCK, INSERT, ATTRIB) is fully present.
- Automation-friendly. Parsers on every popular language: ezdxf for Python, dxfgrabber, jsdxf-parser for JavaScript, ODA SDK for C++.
Cons
- ASCII is 3-5x larger than DWG. A 5 km² city map in DXF ASCII weighs 25-60 MB; same geometry in DWG — 8-15 MB. Binary DXF closes the gap but is rarely used.
- 3D solids limited. ACIS bodies and complex 3D geometry are partially supported.
- Custom application objects — partial. Objects from specialized apps (e.g. Civil 3D stations) often degrade to proxy entities or are lost.
- No xref, OLE, embedded raster. External drawing references, OLE inserts, and embedded rasters aren't preserved in DXF.
- Version dialects. A file written in AutoCAD 2018 (AC1032) won't open in AutoCAD 2004 (AC1018). Save-as version often needs to be specified explicitly.
DXF vs DWG vs SVG — when to choose what
Briefly (full DXF vs DWG comparison — in our dedicated DXF vs DWG article):
| Criterion | DXF | DWG | SVG |
|---|---|---|---|
| Type | ASCII / binary | binary | XML |
| Creator | Autodesk, 1982 | Autodesk, 1982 | W3C, 2001 |
| Purpose | CAD exchange | CAD native | web graphics |
| Size (5 km²) | 25-60 MB | 8-15 MB | 8-20 MB |
| Layers | Full | Full | <g> groups |
| Openness | Open spec | Closed | Open (W3C) |
| Web display | No | No | Yes (browser native) |
| Laser cutting | Standard | Via conversion | Via conversion |
| GIS import | Direct (QGIS, ArcGIS) | Via conversion | Via conversion |
When DXF is the best choice: exchange between different CAD apps, laser cutting, script automation, archival. When DWG: everything inside AutoCAD stack with compactness critical. When SVG: web publishing of a map in the browser, print illustrations, design.
How to make DXF from OpenStreetMap via osm2cdr.ru
Full workflow from selecting an area to opening in LibreCAD — 5 steps, about a minute.
Step 1. Pick a 2-5 km² bbox
Visit osm2cdr.ru, the Leaflet map is on the main page. Find your district, click "Select area" and draw a rectangle. We recommend 1-5 km² for architectural workflow; for laser cutting 200×200 m is enough. On large areas (>100 km²) adaptive thinning kicks in — we cap features at 200,000 to keep the file openable.
Step 2. Pick DXF format
In the "Format" dropdown — DXF. Below the selector you'll see a short description, size estimate, and compatible software list.
Step 3. Pick CRS
For international use — EPSG:3857 (Web Mercator) or EPSG:4326 (WGS 84 lat/lon). For Russian cadastral workflow — the matching MSK zone of the federal subject. Coordinates in DXF will be in your chosen system without re-projection in AutoCAD.
Step 4. Style and detail
Style determines layer colours and overall tone. standard — neutral, per-layer colours, closest to a classic CAD look. blueprint — white lines on a dark blue background for architectural graphics and presentations. minimal — flat pastel tones, easy to recolour by hand or feed to a laser. Detail (1-6) controls geometry simplification: at level 1 buildings round to rectangles, at 6 every bay window is preserved. For most tasks — detail 4.
Step 5. Download and open
Click "Export". In 15-40 seconds (depending on area) a .dxf downloads. Open in LibreCAD (File → Open) — you'll see Buildings, Roads, Water, Green, Railways layers.
Pitfalls and tips
- Cyrillic in pre-2007 AutoCAD. If your AutoCAD 2004/2006 colleague needs DXF with Russian layer or text names — encoding on the 2004 side expects CP1251. Our DXF is written as AC1021 (AutoCAD 2007) and never goes lower: that release is the first to store text as UTF-8, and going below would turn Cyrillic into mojibake. We refuse that on purpose. What works instead: order DWG and pick the release your recipient needs (2000, 2004, 2007, 2010, 2013, 2018) — Cyrillic survives all the way down to 2000 (measured on our converter); or tick "missing labels in Latin" on the label-language step.
- Versions don't go backwards. A newer release won't open in an older AutoCAD. Our DXF is AC1021 (2007), read by AutoCAD 2007 and later. If your colleague's program is older, order DWG and pick its release in the wizard.
- ASCII is 3-5x larger than DWG. For slow channels or email attachments, zip the DXF — it compresses 5-8x.
- Self-intersecting polygons after ST_MakeValid. OSM sometimes has buildings with self-intersecting contours. Our pipeline runs them through
ST_MakeValid, which occasionally turns one contour into MultiPolygon — in DXF this splits into multiple LWPOLYLINEs on one layer. - ACI color 7 on white = invisible. AutoCAD Color Index 7 is "white or black, depending on background." On a white sheet, color 7 layer is invisible. For white-paper print, reassign to ACI 250 (dark gray) or specific RGB.
- Adaptive feature-limit for bbox >100 km². On large areas our exporter caps features at 200,000 (adaptively by zoom level and priorities), otherwise a 3+ GB DXF simply won't open. For full Moscow district detail — tile into 5×5 km chunks and merge via INSERT.
FAQ
How does DXF differ from DWG?
DWG is a closed binary format native to AutoCAD, compact (8-15 MB for a 5 km² map). DXF is open exchange format, usually ASCII (25-60 MB for the same data), readable by any CAD. For exchange between different programs and automation — DXF. For work inside AutoCAD — DWG. More in our DXF vs DWG article.
Which DXF version do we write?
DXF has no version choice here: we always write AC1021 (AutoCAD 2007) — the earliest release that stores text as UTF-8, and one every modern CAD reads. Going lower is a deliberate refusal: below it, Cyrillic labels and layer names arrive as mojibake.
DWG does have the choice — 2000, 2004, 2007, 2010, 2013 and 2018, right in the wizard on the coordinate-system step. Russian labels survive every one of them. If your program refuses to open our file, that is the shortest path.
How to open DXF for free?
LibreCAD — best free 2D CAD on Windows/macOS/Linux. nanoCAD Free — Russian alternative with DWG and MSK support. QGIS — for combining with GIS data. FreeCAD — for 3D. More free options — in our autocad-map-import article.
Why aren't my DXF layers visible?
Check layer ACI color. Color 7 ("white/black") on white background = invisible. Recolor the layer to ACI 250 (dark gray) or specific RGB via Layer Properties Manager.
Cyrillic shows as mojibake in AutoCAD 2004 — what to do?
Pre-2007 AutoCAD uses a local codepage (CP1251 for the Russian version) while our DXF is UTF-8 (the post-2007 standard). We cannot take DXF below that line — it is exactly where the text breaks.
Two things do work: order DWG and pick release 2004 in the wizard (binary DWG keeps Cyrillic in old releases too — verified down to 2000), or turn on "missing labels in Latin" on the label-language step and get readable text in any program.
Can DXF hold 3D?
Yes, with caveats. DXF supports 3DFACE, 3DSOLID, MESH, SURFACE — but ACIS bodies and complex B-Rep geometry transfer with losses. For full-fidelity 3D, IFC or OBJ is better; DXF suits 2.5D (extruded buildings) and simple 3D primitives.
DXF for laser cutting — what to know?
Only closed contours (LWPOLYLINE with closed flag). No HATCH, TEXT, INSERT — the laser won't understand them. Layer color usually maps to mode (cut/score/engrave) in the controller. Full workflow — in our DXF for laser cutting article.
Related and resources
Internal materials:
- DXF vs DWG — Which Format to Choose — detailed Autodesk format comparison.
- DXF for laser cutting — craft and CNC workflow.
- Importing maps into AutoCAD — full instructions for AutoCAD 2018+.
- Export OSM to DWG for AutoCAD — DWG alternative.
- KOMPAS-3D integration — workflow for Russian engineers.
- Batch export automation — REST API + ezdxf for bulk processing.
Format hubs:
- /formats/dxf/ — short DXF hub with FAQ and software.
- /formats/dwg/ — DWG for comparison.
Sources
- Autodesk DXF Reference 2018 — official specification.
- DXF Group Codes Reference — full group code list.
- Library of Congress — DXF Format Description — sustainability rating.
- Wikipedia: AutoCAD DXF — overview and timeline.
- ezdxf documentation — Python library for DXF parsing.
- LibreCAD wiki — open-source CAD with DXF examples.