KML to GeoJSON
Paste KML or drop a .kml file, get GeoJSON. 100% in-browser — your file never leaves your device. The result is saved to your session so you can jump straight to the viewer or any other tool.
KML to GeoJSON
Before you start
You need one of the following:
- A
.kmlfile exported from Google Earth, ArcGIS, or a GPS device, or - Raw KML text (XML) that you can paste directly into the input pane.
Note that KMZ files are not supported directly. KMZ is just a zipped folder containing a doc.kml file. If you have a KMZ, unzip it on your computer first and grab the KML file from inside.
Everything happens in your browser. There is no file size limit other than what your RAM can handle. For files over 50 MB, your browser might "stutter" during the XML parsing phase — just give it a few seconds to breathe.
How to use it
- Paste your KML code into the left pane, or drop a
.kmlfile anywhere on the page. - Click Convert to trigger the parser.
- Check the status bar at the bottom to see how many features were successfully extracted.
- Review the GeoJSON in the right pane. If it looks correct, click Copy or Download .geojson.
- Optionally, click the link in the intro to jump straight to the GeoJSON Viewer with your data loaded.
Example
Input (KML Placemark):
<Placemark>
<name>Golden Gate</name>
<Point>
<coordinates>-122.478,37.819,0</coordinates>
</Point>
</Placemark>
Output (GeoJSON Feature):
{
"type": "Feature",
"properties": { "name": "Golden Gate" },
"geometry": {
"type": "Point",
"coordinates": [-122.478, 37.819, 0]
}
}
Tips & common pitfalls
- Styling is stripped. GeoJSON has no official standard for colors or icons. We save the
styleUrlin the feature properties, but hex codes and line widths are ignored—unlike when using the GeoJSON to KML tool for the reverse process. - Z-coordinates are preserved. If your KML has altitude data (the third number in a coordinate string), it stays in the GeoJSON as a 3D coordinate.
- ExtendedData vs. SimpleData. We try to flatten KML's complex data schemas into simple key-value pairs in the GeoJSON
propertiesobject. If your KML uses very exotic nested schemas, check the output carefully with the GeoJSON Validator. - MultiGeometry is handled. A single Placemark containing multiple paths or points will be converted into a
GeometryCollectionorMultiLineString/MultiPolygonas appropriate.
Troubleshooting
The output is empty or says "0 features".
This usually means the XML is malformed or uses an unsupported namespace. Ensure your KML starts with a valid <kml> tag and that you aren't trying to paste a KMZ file. Check the browser console (F12) for specific XML parsing errors.
My coordinates look backwards (lat/lng vs lng/lat).
KML and GeoJSON both use Longitude, Latitude order (per RFC 7946). If your source data was flipped, it will stay flipped here. Use a separate transformation tool if you need to swap axes.
The browser tab crashed on a large file.
Large XML files are memory-intensive to parse because the browser builds a full DOM tree. Try stripping out unnecessary <Style> blocks from the KML text before pasting to reduce the memory footprint.
Related tools
See also: if you need to do something adjacent on this site, try GeoJSON to KML to convert GeoJSON to KML for Google Earth, GeoJSON to CSV to flatten a feature collection into a CSV table, or GPX to GeoJSON to turn GPX tracks into GeoJSON.
Frequently asked questions
Does it support KMZ files?
Not directly. KMZ is a zipped archive. You need to unzip it and use the .kml file found inside (usually named doc.kml).
What happens to my KML folders?
GeoJSON is a flat list of features. Any <Folder> or <Document> structure in your KML is removed, though we sometimes keep the folder name as a property if the parser supports it.
Is my data private?
Yes. I don't run any server-side processing. Your KML is parsed locally in your browser's memory using JavaScript. Nothing is uploaded to a server.
Can I convert hundreds of files at once?
This UI is built for one-at-a-time use. For bulk conversion, I recommend using the togeojson CLI or ogr2ogr (part of the GDAL suite).
Are Z-values (altitude) supported?
Yes. If your <coordinates> tags include a third value for height, it is preserved in the resulting GeoJSON coordinate array.