KML to GeoJSON Converter
Convert KML to GeoJSON (and GeoJSON back to KML) instantly in your browser. Your map data stays on your device.
Your KML and GeoJSON are converted locally in your browser and never uploaded, so private survey points, routes, and boundaries stay on your device.
Need to plot a coordinate? Try the Coordinate Map Viewer.
About KML to GeoJSON
This KML to GeoJSON converter turns the KML you exported from Google Earth, My Maps, or a GIS tool into standard GeoJSON that mapping libraries like Leaflet, Mapbox, and OpenLayers can read directly. Switch the direction to go from GeoJSON to KML when you need to open your data back in Google Earth. Points, lines, polygons, and their placemark names and descriptions are carried across, and the GeoJSON side is pretty-printed so it is easy to scan and drop into code. Paste your markup or load a file with the file picker, then copy the result or download it with the right extension. It is built for GIS analysts, web-map developers, and anyone shuffling geodata between formats. Every conversion runs entirely in your browser, so your coordinates and place names are processed locally and never leave your device.
Features
- Converts KML to GeoJSON and GeoJSON back to KML with a single direction toggle
- Handles Points, LineStrings, Polygons, and MultiGeometry placemarks
- Carries placemark name and description into GeoJSON feature properties
- Pretty-prints the GeoJSON output so it is readable and diff-friendly
- Load a .kml, .geojson, .json, or .xml file with the file picker, or paste directly
- Copy the result or download it as data.geojson or data.kml
- Clear, inline error messages for malformed XML or invalid JSON
- Runs fully in your browser — no upload, so it works with private map data
How to use the KML to GeoJSON
- Pick a direction: KML → GeoJSON or GeoJSON → KML.
- Paste your KML or GeoJSON into the input box, or click Choose file to load one.
- Read the converted output in the panel on the right.
- Click Copy to grab the result, or download it as data.geojson or data.kml.
Example
Input
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Eiffel Tower</name>
<Point><coordinates>2.2945,48.8584,0</coordinates></Point>
</Placemark>
</Document>
</kml>
Output
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [2.2945, 48.8584, 0] },
"properties": { "name": "Eiffel Tower" }
}
]
}
A KML Placemark Point becomes a GeoJSON Feature with its name in properties.
Common errors & troubleshooting
- The output shows an "Invalid XML" error even though the file looks fine. — KML is XML, so every tag must be closed and nested correctly. Re-export the file, or paste the full document starting with the <kml> root element.
- You loaded a .kmz file and nothing converts. — KMZ is a zipped KML. Unzip it first (rename to .zip and extract, or use Google Earth to export plain KML) and paste the resulting doc.kml.
- Converting GeoJSON to KML fails with an "Invalid JSON" message. — Make sure the input is valid GeoJSON — a Feature, FeatureCollection, or Geometry object. Run it through a JSON formatter to spot a stray comma or bracket.
- Styles, icons, and colors from the KML are missing in the GeoJSON. — GeoJSON is a geometry-and-properties format with no visual styling, so KML <Style> blocks are intentionally dropped. Re-apply styling in your map library.
Frequently asked questions
- Can I convert a KMZ file?
- Not directly. A KMZ is a ZIP archive containing a KML file (usually doc.kml) plus assets. Unzip it first — rename it to .zip and extract, or export plain KML from Google Earth — then paste or load the KML here.
- Are KML styles and icons preserved in the GeoJSON?
- No. GeoJSON only describes geometry and properties, so KML <Style>, <IconStyle>, and color elements have no equivalent and are dropped. The geometry, placemark names, and descriptions are kept; re-apply visual styling in your mapping library.
- Which geometry types are supported?
- Points, LineStrings, Polygons, and MultiGeometry from KML map to Point, LineString, Polygon, and their Multi* counterparts in GeoJSON, and the reverse works when converting GeoJSON back to KML.
- Does GeoJSON → KML produce a Placemark for each feature?
- Yes. Each GeoJSON Feature becomes a KML <Placemark> with its geometry, and a name or description in the feature's properties is written into the placemark so it labels correctly in Google Earth.
- Is my map data uploaded when I convert it?
- No. The KML to GeoJSON conversion runs entirely in your browser, so your coordinates and place names are processed locally and never leave your device.
Related tools
- GPX to GeoJSON — Convert GPX to GeoJSON and back — GPS tracks, routes and waypoints to GeoJSON features, or GeoJSON back to a GPX file.
- WKT to GeoJSON — Convert WKT (Well-Known Text) to GeoJSON and back, in your browser.
- GeoJSON to CSV — Convert a GeoJSON FeatureCollection to CSV and back — Point features become latitude/longitude columns with their properties.
- Coordinate Map Viewer — Plot a latitude/longitude on an OpenStreetMap map, or click the map to read coordinates back out.
- JSON Formatter — Beautify, minify and validate JSON with error locations.
All ArrayKit tools