KML to GeoJSON Converter
Convert Google Earth KML placemarks, lines, and polygons into a standards-compliant GeoJSON FeatureCollection.
Paste KML or upload a .kml file and receive a clean GeoJSON FeatureCollection back. The converter walks placemarks, multi-geometries, and styled folders, preserving names and descriptions on the resulting Feature properties. Output renders in any tool that reads RFC 7946.
KML grew out of Google Earth and was standardised by the OGC as KML 2.3. It encodes points, lines, polygons, and styled features in XML, with Placemarks holding the geometry and metadata. GeoJSON, defined in RFC 7946, is the format web tooling actually reads. Converting between them is a routine step in any pipeline that ingests user-supplied Earth files or syndicates open data to a web map.
The converter parses the XML in your browser with the DOMParser API, then hands the document to togeojson. That library walks Placemarks and Folder structures, mapping Point, LineString, Polygon, and MultiGeometry into their GeoJSON equivalents and copying name, description, and extended data onto the Feature properties. The output is pretty-printed and ready to paste into a GeoJSON viewer, a spatial database loader, or a fetch-driven web map.
The result is RFC 7946 compliant: WGS 84 coordinates in longitude, latitude order, with altitude included where the KML carried it.
- 1
Provide KML
Upload a .kml file or paste the XML into the input field. KMZ archives should be unzipped first since KMZ is a ZIP wrapping a KML file.
- 2
Convert
Click Convert. The XML is parsed locally, then togeojson translates Placemarks into Features and assembles a FeatureCollection.
- 3
Use the output
Copy the JSON, download it as .geojson, or feed it into your spatial workflow. Properties from the source are preserved.
Web map ingestion
Turn a tour created in Google Earth into a layer for a Mapbox or MapLibre web map without leaving the browser.
Database import
Prepare a Placemark export for ingestion into PostGIS or DuckDB Spatial, both of which read GeoJSON directly.
Format normalisation
Standardise mixed contributions from a community of mappers who saved files in whatever Earth produced.
Diff and version control
GeoJSON is text and diffs cleanly in git, unlike KML wrapped in heavy styling tags.
Does my KML data leave the browser?
No. The XML is parsed in the page and conversion happens entirely client-side. Nothing is sent to a server.
What about KMZ files?
KMZ is a ZIP archive containing a KML. Extract the .kml from the .kmz first, then paste or upload it here.
Are styles preserved?
GeoJSON has no styling vocabulary, so colours and icons are dropped. Names, descriptions, and ExtendedData are preserved on each Feature's properties.
Which geometry types are supported?
Point, LineString, Polygon, and MultiGeometry. Network links and overlays are not geometry and are skipped.
Is the output valid RFC 7946?
Yes. Coordinates are emitted in longitude, latitude, and optional altitude order. The result loads in any compliant GeoJSON reader.