KML to GeoJSON Converter
Paste KML content or drop a .kml file to instantly convert Google Earth placemarks, paths, and polygons into standard GeoJSON. Runs entirely client-side using the same parsing logic as Mapbox's toGeoJSON library, so your geodata never leaves your device.
Reviewed by Vincenzo Manto, Founder & Lead Developer · Last updated September 27, 2026
How it works
- 1
Paste your KML markup or drop a .kml file into the input box.
- 2
The tool parses the XML with a browser DOMParser and converts it with toGeoJSON.
- 3
The resulting GeoJSON FeatureCollection appears instantly on the right, along with a feature count and geometry types found.
- 4
Copy it to your clipboard or download it as a .geojson file.
Why convert KML to GeoJSON?
KML is the XML format used by Google Earth and Google My Maps, while GeoJSON is the open standard understood by nearly every modern mapping library, including Leaflet, Mapbox GL, OpenLayers, Turf.js, and most GIS databases. Converting KML placemarks and paths to GeoJSON is usually the first step in bringing map data exported from Google's tools into a custom web map or a spatial analysis pipeline.
Accurate, standards-based conversion
Rather than a hand-rolled regex-based parser, this tool uses a real XML DOM parser and the same conversion logic that powers toGeoJSON, the library maintained for Mapbox's own tooling. That means nested placemarks, MultiGeometry elements, and extended data fields are handled the way GIS professionals expect.
Private by design
Because everything runs as JavaScript in your own browser tab, your location data, which can be sensitive, from survey routes to property boundaries, never touches a server. This makes the tool safe to use even for confidential or proprietary geodata.
Frequently asked questions
Does this upload my KML file to a server?
No. The KML is parsed and converted entirely in your browser using the DOMParser API and the toGeoJSON library, so nothing is ever sent anywhere.
What KML elements are supported?
Placemarks with Point, LineString, Polygon, MultiGeometry, and their extended data are converted, following the same conversion rules as the widely-used @tmcw/togeojson library used by Mapbox and many GIS tools.
Can I convert a KML file exported from Google Earth or Google My Maps?
Yes. Files exported from Google Earth, Google My Maps, and most GIS software that produce standard KML 2.2 markup will convert correctly.
What if my file is a KMZ (zipped KML)?
This tool expects plain KML (XML) text. If you have a .kmz file, unzip it first (most archive tools can open a .kmz as a .zip) and use the .kml file inside it.
Will folder structure and styles be preserved?
Feature-level metadata like name and description are mapped to GeoJSON properties, but KML-specific concepts like folders, styles, and icons don't have a direct GeoJSON equivalent and are not included in the output.