Convert DXF to KML

This converter turns a DXF drawing from AutoCAD, BricsCAD or another CAD program into a KML file for Google Earth, Google My Maps or any web map. You enter the coordinate system of the drawing as an EPSG code, and the coordinates are converted to longitude and latitude. Each CAD layer becomes a folder, lines and areas keep their CAD colors, and texts become labels. The DXF is read 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

DXF to KML: why convert

A site plan, a survey or a utility drawing in DXF is hard to show to someone without CAD software, while almost everyone can open a KML in Google Earth or on a phone. This page reads the DXF with GDAL, the open-source library behind QGIS, converts the coordinates from the drawing's grid (a UTM zone, a national grid or a State Plane zone) to WGS84 longitude and latitude, which KML requires, and writes one KML. Every CAD layer becomes a folder you can switch on and off in Google Earth. Lines keep their CAD color and lineweight, hatches are filled, closed polylines such as building outlines and parcels become areas, and TEXT and MTEXT entities appear as labels at their insertion point. The map preview shows where the drawing lands before you convert, and nothing is sent to a server.

How to convert DXF to KML

  1. Drop your .dxf file in the box, or click to choose it. A .dwg must be saved as DXF first.
  2. Enter the coordinate system of the drawing as an EPSG code, such as EPSG:25832 for UTM zone 32N, or click one of the suggestions, and check that the map shows the drawing in the right place.
  3. Keep or untick "Closed polylines and circles become polygons", click Convert to KML and open the file in Google Earth or import it into My Maps.

What changes when you convert

The EPSG code decides where the drawing lands

A DXF stores coordinates as plain numbers without a coordinate system, but a KML must be in longitude and latitude, so the converter has to know the drawing's system. Values such as 556000, 6324000 are UTM metres (for example EPSG:25832 in Denmark or Germany); 6-digit values in Britain are usually the British National Grid (EPSG:27700). The suggestions under the field list systems in which the numbers make sense. With the wrong code the drawing appears in the wrong country or is shifted by a few hundred metres, which the map preview shows before you convert.

Drawings in local coordinates

Architect drawings are often drawn around 0,0 in millimetres or metres and are not tied to the ground at all. No EPSG code fits them, and the status line warns when the result lands near 0° longitude and 0° latitude in the Atlantic Ocean. Such a drawing must be georeferenced first, for example with the Georeferencer or the Vector Bender plugin in QGIS, or moved onto survey coordinates in CAD.

Colors, lineweights and texts

Each entity keeps its CAD color, with ByLayer and ByBlock resolved. Color 7, white on a dark CAD screen, stays white, which shows up on aerial imagery. Lineweights become 1 to 8 pixels; Google Earth draws lines with the same width at every zoom level. Texts are labels without a pin, with the CAD text color, but Google Earth shows them upright and at its own size, not at the height and rotation of the drawing. Line types such as dashes and dimension styles are not carried over.

Closed lines become areas

With the box ticked, every closed polyline and circle is written as a polygon with a light fill, so a building or a parcel can be clicked inside and measured in Google Earth. Hatches and solids get a stronger fill. Untick the box if the closed lines are, for example, contour lines that should stay lines.

Blocks, curves and heights

Blocks such as trees, manholes and north arrows are exploded into their lines and circles on the layer of the block insert. Circles, arcs and splines become many short straight segments, because KML has no curves. Shapes without heights follow the terrain in Google Earth; real heights, such as contour elevations, are kept as altitudes in the coordinates. Paper-space layouts with title blocks are left out.

About the formats

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.

KML

KML (Keyhole Markup Language) is the XML format behind Google Earth and Google My Maps, and an OGC standard since 2008. Besides geometry it can hold styles, icons, folders and descriptions in HTML.

  • Always WGS84 longitude, latitude and optional altitude.
  • Folders group placemarks; each folder can become its own layer when converting.
  • Styles (colors, line widths, icons) are specific to KML and Google Earth.

Frequently asked questions

Can I import the KML into Google My Maps?

Yes. In My Maps, choose Import on a layer and pick the KML. My Maps imports one layer per file and allows at most 2,000 features per layer, so a detailed drawing may be too large; in that case remove layers you do not need in CAD first, or open the KML in Google Earth instead.

Which data is kept for each feature?

The CAD layer, the entity type (such as AcDbPolyline or AcDbCircle) and the entity handle, which Google Earth shows when you click a feature. Texts show their text as the label.

How do I find the EPSG code of a drawing?

Ask whoever made it, or use the suggestions that appear under the field after the DXF is read: they list the coordinate systems in which the drawing's numbers make sense, and the map preview shows where each one puts it.

Is my drawing uploaded?

No. The DXF is read and converted by your browser on your own computer, and nothing is sent to a server.

Can I convert a KML back to DXF?

Yes, with the KML to DXF converter, which converts the coordinates to UTM metres or your national grid and puts each KML folder on a CAD layer.