KML to GeoJSON

GeoJSON is what web map libraries and QGIS read without a fuss. Drop a KML or KMZ and get a .geojson with every placemark, path and polygon as a feature.

Options

Your file is converted on your computer. It is not uploaded anywhere.

How it works

  1. Drop your file in the box above, or click it to pick one.
  2. Pick the output format and press Convert.
  3. Download the result. Nothing was uploaded on the way.

Is it safe?

The KML is parsed by your browser, right here, and the GeoJSON is written the same way. Nothing goes to a server.

Want to check? Open your browser DevTools, switch to the Network tab and convert a file. Or convert a small file once, because each converter downloads its code the first time, then go offline and convert your real file.

KML is Google's, GeoJSON is the web's

KML started out in Keyhole's Earth viewer, the program Google bought and turned into Google Earth, and it later became an OGC standard. It's XML with styles, folders and camera views mixed in with the data. GeoJSON (RFC 7946) is plain JSON holding geometry and properties and not much else. That's why a JavaScript map can load it in one line and QGIS opens it without asking questions.

Exports from Google My Maps and Google Earth come out as KML or KMZ, so this is the usual first step before that data goes on a map of your own.

What each feature carries

  • Geometry. Points, lines and polygons (holes included) become features. A placemark with several shapes, a MultiGeometry in KML terms, becomes a GeometryCollection.
  • Coordinates. Longitude first, then latitude, then altitude if there is one. KML uses the same order and the same WGS84 degrees, so the numbers are copied, not reprojected.
  • Name, description and ExtendedData. They become properties of the feature. A description written in HTML is kept as a small object with the markup inside.
  • Styles. Line colour and width, fill colour and opacity and the icon's link turn into properties named in the simplestyle way (stroke, fill, icon...). Some web map tools pick these up, plenty ignore them.
  • Time. A TimeStamp becomes a timestamp property, a TimeSpan becomes timespan with begin and end, and a recorded gx:Track keeps its per-point times in coordinateProperties.times.

Left behind

Folders are flattened into one FeatureCollection, so their names are gone. Network links aren't followed, ground overlay images can't live in GeoJSON (their outline is kept at most), and 3D models are skipped. Each of these gets a note when it happens, so nothing vanishes quietly.

Other outputs and limits

The output list here also has GPX, for GPS devices and apps, and CSV for a spreadsheet. KMZ works as input too: the KML inside is unpacked in the browser, the rest of the zip is ignored. One file per run, up to 50 MB and 5 million coordinate points, which is a lot of hiking.

Questions about this format

Does the GeoJSON keep my My Maps layers apart?

No. Layers and folders are flattened, so every feature sits in one FeatureCollection. If you need them separate, export each layer from My Maps on its own and convert the files one by one.

Is the GeoJSON output in WGS84?

Yes. KML coordinates are always WGS84 longitude and latitude, and GeoJSON expects exactly that, so no reprojection is involved.

Why is the GeoJSON file one long line?

It's written without indentation to keep it small. Any code editor with a format command, or a JSON viewer, will pretty-print it.

Can I go from KMZ straight to GeoJSON?

Yes, drop the .kmz here. Icons and photos packed inside it aren't part of the GeoJSON, only the links to them.

Last updated: