DXF Converter: DXF to KML, KMZ, Shapefile and GeoJSON
Load an AutoCAD or other CAD drawing, choose its coordinate system and check the layers on the map. Download KML/KMZ for Google Earth, or a shapefile and GeoJSON for GIS.
Output
KML, KMZ and GeoJSON are always written in WGS84 (latitude, longitude). The shapefile comes with a .prj and a UTF-8 .cpg; points, texts, lines and polygons are separate layers.
Layers
Layers that are off or frozen in CAD start unticked.
Entity types
Options
If layer names or texts show broken characters, choose the encoding manually.
Your file and network requests
The DXF file is read, converted and downloaded in your browser; the drawing is not sent to a server. The basemap tiles of the preview map come from Esri and OpenStreetMap servers (the requests contain only the tile numbers of the area on screen). If you enter an EPSG code that is not in the list, only that code is looked up on epsg.io.
Related Tools
Why convert a DXF drawing to KML or a shapefile
Survey and construction drawings are usually produced in CAD and shared as DXF. DXF is a drawing format and in most cases it does not say which coordinate system it uses. Google Earth, web maps and GIS software, on the other hand, expect data in a defined coordinate system together with its attributes. This tool reads the geometry in a DXF, transforms it from the system you choose to WGS84 and writes KML/KMZ for Google Earth, or a shapefile and GeoJSON for GIS. Typical uses are checking a parcel boundary against imagery in Google Earth and bringing a project boundary into a GIS layer.
How to use it
- Drop the DXF file into the box. If you have a DWG, convert it first with the DWG to DXF tool.
- Choose the source coordinate system. The tool suggests one from the coordinate range; check the suggestion against the satellite image on the map.
- Untick layers you do not need, such as dimensions, sheet frames or title blocks. The entity type boxes let you leave out texts or block positions as well.
- Press KML, KMZ, Shapefile or GeoJSON. For the shapefile you can choose the output system separately; by default it keeps the DXF's own system.
Choosing the coordinate system
Most engineering drawings use a transverse Mercator grid such as UTM (6° zones) or a national 3° grid. Eastings around 500,000 are typical for both, but the numbers do not reveal the zone, so you pick the zone or central meridian yourself. Choosing the neighbouring zone moves the data by hundreds of kilometres. The coordinates cannot reveal this mistake, so compare the result with the satellite image. In Türkiye, current large-scale maps use ITRF96 (TUREF) 3° TM with central meridians 27 to 45; eastings between 9,500,000 and 15,500,000 carry a Gauss-Krüger zone prefix, and the tool then detects the zone itself.
Older maps are often on the ED50 datum. For Türkiye the tool uses the EPSG:1784 transformation (about 2 m), for mainland Spain EPSG:1633 (about 1.5 m). Mixing up ED50 and a modern frame shifts data by roughly 180 m in Türkiye and 230 m in Spain. For any other system you can enter an EPSG code or a proj4 definition.
What is converted
- Lines: LINE, LWPOLYLINE, 2D and 3D POLYLINE, ARC, ELLIPSE and SPLINE. Polyline arcs (bulges) and arc, circle and spline curves are split into vertices so that the chord deviation stays below 1 cm.
- Polygons: closed polylines, circles, closed splines, SOLID and HATCH boundaries. Islands inside a hatch are kept as holes.
- Points and texts: POINT, TEXT and MTEXT. A text becomes a point with a Text attribute and shows as a label in Google Earth.
- Blocks: every INSERT becomes a point with the block name and attribute (ATTRIB) values. Optionally the block contents are exploded into lines and polygons as well.
Each feature carries Layer, Entity, Color, RGB, Linetype, Elevation, RefName (block name) and, for texts, Text. In the KML every DXF layer is a folder and lines keep the layer or entity color from the drawing. Paper space (layout) entities, dimensions (unless blocks are exploded), 3D surfaces and image references are not converted.
Special characters
DXF files from AutoCAD 2007 onwards are UTF-8. Earlier versions write text in a code page such as ANSI_1252 or ANSI_1251. The tool reads $DWGCODEPAGE and the file version to choose the encoding, and decodes \U+ escapes and special codes such as %%d (degree sign). Shapefile attributes are written in UTF-8 with a .cpg file, so ArcGIS and other GIS software display accented and Cyrillic letters correctly.
Data and method
The DXF parser was written for this tool and runs entirely in the browser. It handles object coordinate systems (OCS), block scale and rotation, nested blocks and NURBS curves. Coordinates are transformed with proj4js 2.9.0 (MIT licence) and KMZ and zip files are packed with JSZip 3.10.1 (MIT licence). The preview map runs on Leaflet 1.9.4 (BSD-2-Clause licence) and the icons come from Lucide (ISC licence). Basemaps belong to Esri and OpenStreetMap contributors.
Accuracy limits
- The conversion uses the DXF coordinates as they are. A drawing made in local units or scaled after the fact will not line up with the map.
- Datum shifts such as ED50 to WGS84 are accurate to a few metres. Cadastral and setting-out work that needs centimetres calls for official regional transformation parameters.
- Splines saved only with fit points are rebuilt approximately. Linetypes, lineweights and hatch patterns are not carried over; a hatch arrives as its boundary only.
For larger projects
If you need to bring a large CAD archive into a GIS database with layer mapping rules, Rodosto Teknoloji works on CAD to GIS migrations for engineering firms and municipalities. You can read more on the Rodosto Teknoloji website or send us a message.
Frequently Asked Questions
How do I open an AutoCAD drawing in Google Earth?
Save the drawing as DXF, load it here, choose its coordinate system (for example UTM zone 33N) and download KML or KMZ. Google Earth expects WGS84 latitude and longitude; the tool converts the coordinates for you and puts each DXF layer in its own folder.
Why does my drawing land in the wrong place?
The most common cause is the wrong zone or central meridian. Transverse Mercator coordinates do not record their zone, so picking the neighbouring zone shifts the data by roughly 250 to 500 km. A wrong datum (for example ED50 instead of a modern frame) usually causes a shift of 100 to 250 m. If X and Y were written the other way round, use the swap option.
Can I convert a DWG file directly?
No. DWG is a closed binary format. Create an ASCII DXF first with the DWG to DXF tool or with Save As in your CAD software, then load it here.
Is my file uploaded to a server?
No. Reading the DXF, transforming coordinates and writing KML, shapefile and GeoJSON all happen in your browser. Only the basemap tiles of the preview map are downloaded from Esri and OpenStreetMap servers, and if you enter a custom EPSG code its definition is fetched from epsg.io.