Drag and drop a .kml or .kmz file here

From Google Earth, Google My Maps or any GIS. GPX files and zipped shapefiles work here too.

Summary

Feature count, geometry types, bounding box and the detected coordinate system appear here after conversion.

Map preview

The converted features are drawn here, on a plain background. Switch the basemap on to see them over OpenStreetMap.

The basemap is off by default: switching it on loads tiles for the area you view from openstreetmap.org. Your file itself is never sent.

Open the result in:

Have a shapefile from QGIS or ArcGIS? Use the Shapefile to GeoJSON converter. Have a GPS track? Use the GPX to GeoJSON converter.

How the KML to GeoJSON Converter works, and what it assumes

KML (Keyhole Markup Language) is the XML format Google Earth made popular and the OGC later standardised. You meet it as a download from Google My Maps, as the export of a Google Earth Pro project, and on government and utility open-data portals that publish boundaries for people to open in Google Earth. GeoJSON describes the same points, lines and polygons as JSON, which is what Leaflet, OpenLayers, Mapbox GL and most web APIs read natively. The converter reads the KML's XML itself, turns every Placemark into a GeoJSON Feature, and writes a FeatureCollection that follows RFC 7946.

Coordinates need no reprojection. KML is always WGS 84 longitude, latitude and optional altitude, the same system and order GeoJSON uses (EPSG:4326), so each number carries over unchanged apart from the precision you choose, and altitude stays as the third value. Polygon rings are rewound where needed so outer boundaries run counter-clockwise and holes clockwise, as RFC 7946 asks.

KMZ and KML

A KMZ is simply a zipped KML, usually with its icons and overlay images packed alongside. The converter unzips it in your browser and reads doc.kml, the document Google Earth opens, or the first KML when that name is missing. Images stay behind, because GeoJSON only holds vector geometry. A tiny KMZ that converts to nothing is usually a NetworkLink pointing at data on a server; the notes show its address.

Folders, styles and ExtendedData

GeoJSON has no folders, so each feature gets a folder property with its path, such as Survey / Day 2, which you can filter or group on later. Shared styles and StyleMaps are resolved to the colours actually shown and written as simplestyle properties (stroke, fill, fill-opacity and so on), which is also how the map preview colours the result. Every ExtendedData value becomes a property of its own, as text, next to name and description.

How your data is handled

The file is read and converted by JavaScript on your device and is never uploaded. The map preview draws on a plain background; only if you switch on the OpenStreetMap basemap are map tiles requested for the area on screen. Have a different format? Use the Shapefile to GeoJSON converter for zipped shapefiles or the GPX to GeoJSON converter for GPS tracks. To take the result further, turn it into database geometry with GeoJSON to WKT, check polygons with the Geometry Validator, or reproject it with ST_Transform.

Where this comes up in GIS work

  • Putting a site plan or survey drawn in Google Earth Pro onto a Leaflet or OpenLayers web map.
  • Exporting a Google My Maps layer (Export to KML/KMZ) into a format a JavaScript app or an API accepts.
  • Loading placemarks from a government KMZ, such as ward or constituency boundaries, into PostGIS via GeoJSON.
  • Keeping the colours of a styled KML as simplestyle properties so geojson.io or Mapbox draws it the same way.

A worked example

A stop from a walking tour, saved in Google Earth inside a folder called Stops, with the order of the stop stored as ExtendedData:

<Folder>
  <name>Stops</name>
  <Placemark>
    <name>Vidhana Soudha</name>
    <ExtendedData><Data name="order"><value>1</value></Data></ExtendedData>
    <Point><coordinates>77.5906,12.9795,920</coordinates></Point>
  </Placemark>
</Folder>

becomes this GeoJSON:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Vidhana Soudha",
        "folder": "Stops",
        "order": "1"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [77.5906, 12.9795, 920]
      }
    }
  ]
}

The folder becomes a property, the ExtendedData value keeps its name, and the altitude of 920 m stays as the third coordinate. The value "1" stays a string, because KML stores every ExtendedData value as text.

Using the KML to GeoJSON Converter

  1. Drop a .kml or .kmz file on the upload box, choose Choose file, or select Paste KML or GPX and paste the text. Load example opens a small heritage walk.
  2. The file converts as soon as it is read. Check the summary: the number of placemarks, their geometry types and the bounding box.
  3. Read the notes under the summary. They list anything GeoJSON cannot hold, such as image overlays or linked network files.
  4. Pick the coordinate precision and whether to keep properties; the result updates straight away.
  5. Copy the GeoJSON, download it as a .geojson file, or open it in GeoJSON to WKT, the Geometry Viewer, the Geometry Validator or ST_Transform.

When the output looks wrong

Line 57: invalid coordinate "77.59;12.97" in <coordinates>
KML positions must be longitude,latitude with a comma and no spaces inside the pair, and pairs separated by spaces or line breaks. A semicolon, a decimal comma or a stray word breaks the list; fix that line in a text editor and convert again.
The KMZ converted but the result is empty
Google Earth and My Maps sometimes save a NetworkLink: a small KMZ that only points at data on a server. The notes name the link. Open that address, save the real KML it returns, and convert that file instead.
My image overlay or 3D model is missing
GroundOverlay images, ScreenOverlays and photo overlays are pictures, not vector geometry, so GeoJSON has nowhere to put them; they are counted in the notes. A 3D Model becomes a single point at its location.
Everything is in one flat list, and I need my folders back
GeoJSON has no folders, so each placemark gets a folder property with its path, such as "Survey / Day 2". Filter or group on that property in QGIS, in your code, or with a jq one-liner.

Questions about the KML to GeoJSON Converter

What is the difference between KML and KMZ?

A KMZ is a KML file zipped together with anything it uses, such as icons or overlay images. This converter unzips a KMZ in your browser, reads the main KML inside it (doc.kml, or the first .kml when there is no doc.kml) and ignores the images, which GeoJSON cannot hold.

Are KML folders and styles kept?

Folders become a folder property holding the path, for example "Stops / Morning". Line, polygon and icon styles, including shared styles and StyleMaps, are resolved and written as simplestyle-spec properties (stroke, stroke-width, fill, fill-opacity, marker-color), which Leaflet, geojson.io and Mapbox tools understand.

What happens to ExtendedData and descriptions?

Every Data value and SchemaData SimpleData field becomes a property of the same name, as a string, alongside name and description. HTML in a description is kept as text exactly as written, so nothing in it runs.

Do I need to reproject KML coordinates?

No. KML is always WGS 84 longitude and latitude with an optional altitude, which is exactly what GeoJSON (RFC 7946, EPSG:4326) uses, so the numbers carry over unchanged apart from the precision you choose. Altitude is kept as the third value of each position.

How do I convert Google My Maps to GeoJSON?

In My Maps, open the menu next to the map title, choose Export to KML/KMZ, pick the layer and download it. Drop that file here. Tick "Export to a .KML file" in that dialog if you want plain KML instead of a KMZ; both work.

Is my KML file uploaded?

No. The file is read and converted by JavaScript in your browser and is not sent to our server. The map preview draws on a plain background; the optional OpenStreetMap basemap, off by default, only requests map tiles for the area you are looking at.