How to convert KMZ to GeoJSON
- Drop the .kmz file; there is no need to unzip anything first.
- The embedded KML and the folders inside it are parsed automatically.
- Choose GeoJSON and convert, then plug the FeatureCollection into Leaflet, Mapbox GL or your API.
What changes when you convert KMZ to GeoJSON
| What | KMZ → GeoJSON | |
|---|---|---|
| Geometry | Kept | Points, lines and polygons are preserved exactly, including multi-part shapes. |
| Attributes | Kept | Every column and full field name moves from KMZ into GeoJSON untouched. |
| Styling & labels | Dropped | KMZ colors, icons and description balloons are presentation, not data. GeoJSON stores the underlying features, so styling is dropped (the geometry and attributes remain). |
| Coordinate system | Kept | Both formats are fixed to WGS84 longitude/latitude (EPSG:4326), so the coordinates are copied across without any reprojection. |
| Elevation (Z) | Kept | 3D Z values carry from KMZ into GeoJSON wherever the source records them. |
| File structure | Kept | A single, self-contained .geojson file you can move around on its own. |
Why convert KMZ to GeoJSON?
A KMZ packages a map for emailing, with the KML document zipped alongside any icons and overlays, and that packaging is exactly what a web app does not want. Rewriting the features as GeoJSON puts them where the modern stack can use them: rendered in a browser map, served from an API, or tracked line by line in version control.
Coordinate system handling
Nothing about the zip layer bears on coordinates; the datum travels inside the KML document, which the specification locks to WGS84 degrees. The archive could hold a dozen images and styles without changing what a single longitude in that document means.
Longitude leads in every output position, and RFC 7946 permits no alternative system, so the file ships with no projection metadata to lose. Documentation for an API serving these features can simply state EPSG:4326, and consumers from QGIS to deck.gl will read the collection correctly on that assumption.
What to check when converting KMZ to GeoJSON
GeoJSON has no folders, so nested Google Earth groupings flatten into one FeatureCollection. When the grouping matters, one folder per site for example, add the folder name to each placemark as a property before converting and filter on it in code. Styling does not travel either; colors, icon graphics and label styles from Google Earth stay behind.
Troubleshooting KMZ to GeoJSON
- The output weighs ten times what the archive did. A KMZ is compressed XML while GeoJSON is plain text, so the same features expand considerably on the way out. Serve the file with gzip or brotli, which web servers apply to JSON cheaply, or simplify dense geometry before shipping it to the browser.
- Popup HTML points at files/photo1.jpg and nothing loads. Paths like that were relative to the inside of the archive, a place no web page can reach. Extract the images from the KMZ with a zip tool, host them next to the map, and rewrite the references in the description properties.
- A flight path draws as a line wrapping around the whole world. Paths that cross the 180th meridian confuse planar renderers, which connect minus 179 to plus 179 the long way around. Split the line at the antimeridian, mapshaper and ogr2ogr both can, which is the handling RFC 7946 itself recommends for such geometry.
- A guided tour converts to almost nothing. Tours are camera choreography rather than geometry, so an archive that is mostly flythrough yields only whatever placemarks tag along. Keep the KMZ for presentations in Google Earth and treat the FeatureCollection as the data layer extracted from it.
- A strict API rejects positions that carry a third number. Google Earth records altitude, so positions often leave the archive as three-element arrays, which the specification allows but some validators and endpoints refuse. Strip the elevations with mapshaper or a short turf pass when a consumer complains, since nothing else about the geometry changes.
About the formats
A KMZ is the zipped map you export from Google Earth, with placemarks and paths tucked inside a compressed KML. GeoJSON is what a web map wants to read directly. This conversion opens that archive, pulls out the features, and rewrites them as plain JSON. The typical reason is a Google Earth deliverable that needs to appear in a Leaflet or Mapbox layer or feed a web API. Because both formats sit in WGS84 lon/lat, the coordinates carry across cleanly.
Frequently asked questions
The output has no features, so what went wrong?
Some KMZ files hold only imagery overlays and icon graphics. Check the file in Google Earth: a FeatureCollection can only carry placemarks, paths and polygons, and imagery-only files leave it empty.
Will QGIS and OpenLayers accept mixed geometry in one file?
Yes. A single FeatureCollection can hold points, lines and polygons together, and both read it without complaint, so there is no need to split the file by geometry type.
Why is longitude listed before latitude in the coordinates?
GeoJSON stores X before Y, which puts longitude first by specification. Nothing is swapped, and libraries that read GeoJSON expect that order.
What happens to the icons and overlays bundled inside the KMZ?
They are not written into the GeoJSON, which carries geometry and attributes only. Placemark names and descriptions survive as feature properties, so restyle the layer in Leaflet or Mapbox GL afterward.
Is GeoJSON the right handoff when the audience uses Google Earth?
No, and the honest answer saves a round trip: a recipient who works in Earth is best served by the KMZ exactly as it is. Convert when the destination is code, a Leaflet or Mapbox layer, an API response, or a repository where plain-text diffs matter.
How do I sanity-check the output before wiring it into an app?
Drop the file onto geojson.io or load it in QGIS, and the FeatureCollection renders in seconds with every property inspectable per feature. Checking there first separates conversion questions from map-code questions, which saves debugging the wrong layer of the stack.
Related converters
Ready to convert?
Drop a file and download the result in seconds. Nothing is uploaded, nothing is stored.