Convert GeoJSON to DXF
This converter turns one or more GeoJSON files into one DXF drawing for AutoCAD, BricsCAD, DraftSight or LibreCAD. GeoJSON in longitude and latitude is converted to metres in the UTM zone of the data, or to the system you enter; a GeoJSON that already has a projected coordinate system keeps it. Each file becomes a CAD layer, and a field such as the name can be written as text. The files are converted in your browser and not uploaded.
Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.
Key facts
- Input: GeoJSON (.geojson). Output: DXF (.dxf).
- Your files are not uploaded: the work is done in your browser, on your own device.
- File size: no fixed limit; very large files are limited by your device's memory.
- Needs a current browser (Chrome, Edge, Firefox or Safari) on a computer, tablet or phone; nothing to install.
- Free to use, with no sign-up.
GeoJSON to DXF: why convert
GeoJSON is the format of web maps, geojson.io, OpenStreetMap exports and most map APIs, but a CAD program cannot open it, and its coordinates are usually longitude and latitude in degrees, which CAD draws tiny and distorted. This page reads the GeoJSON in your browser with GDAL, the open-source library behind QGIS, converts the coordinates to metres in the UTM zone where the data lies (or to the national grid you enter), and writes one DXF. Points become DXF points, lines become polylines, and polygons become closed polylines, holes included. Each GeoJSON file ends up on its own CAD layer, or you choose a field whose values become the layers, and the values of a field such as name can be written as text next to the shapes. Nothing is sent to a server.
How to convert GeoJSON to DXF
- Drop one or more .geojson or .json files. Several files go into one DXF, each on its own layer.
- Check the output coordinate system. For longitude and latitude the UTM zone of the data is filled in; replace it with the grid your CAD drawing uses, such as EPSG:25832, EPSG:27700 or a State Plane zone.
- Choose what the CAD layers are named after and which field is written as text, then click Convert to DXF.
What changes when you convert
Pick the coordinate system of the drawing
Standard GeoJSON (RFC 7946) is in WGS84 longitude and latitude. The converter fills in the UTM zone where the data lies, so the drawing is in metres and can be measured. If the data has to line up with an existing CAD drawing, enter that drawing's system instead, for example ETRS89 / UTM zone 32N (EPSG:25832), the British National Grid (EPSG:27700) or a State Plane zone in US feet. A DXF does not store the system, so tell the CAD user which one you chose.
A GeoJSON in metres without a "crs"
QGIS can save GeoJSON in a projected system such as UTM. With a "crs" member in the file, that system is read and kept, and nothing is filled in. Without it, the coordinates in metres cannot be WGS84; the converter then asks for the EPSG code of the data before it converts.
The properties are left out
A DXF has no attribute table. Only the geometry, the layer name and, if you want, one field as text are written. The other properties and simplestyle colors from geojson.io do not come along; every entity gets the color of its CAD layer (ByLayer). To keep the attributes, convert the same GeoJSON to a shapefile or CSV as well.
The text height is a guess
Texts are written about 1/250 of the drawing width high, rounded to 1, 2 or 5 metres (or another power of ten), and the status line says the height. In AutoCAD you can select all texts with QSELECT and change the height in one go.
About the formats
GeoJSON
GeoJSON is a plain-text JSON format for geographic features, standardized as RFC 7946 in 2016. It is the native format of web maps such as Leaflet, MapLibre and Mapbox, and of many APIs.
- Coordinates are WGS84 longitude, latitude (in that order).
- Points, lines and polygons can be mixed in one file.
- Properties can be any JSON value, with no limit on field name length.
DXF
DXF (Drawing Exchange Format) is the open exchange format of AutoCAD, published by Autodesk since 1982. Surveyors, architects and engineers use it to pass CAD drawings between programs. A DXF holds lines, polylines, arcs, circles, text, hatches and blocks on named layers, but no attribute table and no coordinate system.
- Plain text (or binary) with drawing entities on named layers; blocks are reusable symbols inserted many times.
- There is no attribute table: besides the geometry, an entity has a layer, a color, a line type and, for text, the text itself.
- The coordinate system is not stored; coordinates are just numbers, often in a national grid or in local site units.
- DWG is AutoCAD's own binary format, not the same thing as DXF.
Frequently asked questions
Which CAD programs open the DXF?
The DXF follows the AutoCAD 2004 format, which AutoCAD, AutoCAD LT, BricsCAD, DraftSight, LibreCAD, QCAD, MicroStation and QGIS all read.
Can I get a DWG instead?
Not directly. Open the DXF in AutoCAD, BricsCAD or DraftSight and use Save As DWG, or convert it with the free ODA File Converter.
Are heights kept?
Yes, when the GeoJSON has a third coordinate that is not zero everywhere, the DXF gets 3D points and polylines. Coordinates that are all zero are dropped, so the drawing stays flat.
My GeoJSON is a single geometry, not a FeatureCollection. Does it work?
Yes. A bare geometry, a single Feature and a FeatureCollection are all read, and so is a .json file from an API, as long as it is GeoJSON.
Is my GeoJSON uploaded?
No. The DXF is written by your browser on your own computer, and nothing is sent to a server.