Free Online KML to GeoJSON Converter (Google Earth Map)
KML to GeoJSON Converter
Convert Google Earth and Google My Maps .kml files into clean RFC 7946 .geojson directly in your browser.
Geometry Preview
Generated GeoJSON Output
Upload a .kml file or paste KML XML above to convert to GeoJSON.
About This Free Online KML to GeoJSON Converter
This free online KML to GeoJSON converter transforms Google Earth and Google My Maps .kml files into clean, web-ready GeoJSON FeatureCollection data right in your browser. While KML is great for desktop globe viewers, modern web mapping libraries like Leaflet, Mapbox, and OpenLayers work natively with .geojson. With this browser-based GIS converter, you can parse points, lines, polygons, and custom ExtendedData attributes, preview the shapes instantly, and download standard .geojson files without uploading sensitive map layers.
How This Tool Works
The converter parses your KML XML with the browser's native DOMParser and walks through every <Placemark> element, including nested <Folder> groups. It converts KML longitude,latitude,altitude strings into numeric GeoJSON coordinate arrays, preserves name, description, and ExtendedData properties, and draws a scaled 2D wireframe preview onto an HTML5 canvas.
Steps to Use This Tool
- Drop your
.kmlfile into the upload box on the left, paste KML XML on the right, or click Load Sample KML to test with sample map features. - Select your preferred coordinate rounding in Precision and toggle Pretty-Print JSON or Keep Altitude (Z).
- Check the Geometry Preview canvas and the Generated GeoJSON Output box to verify your points, lines, and polygons.
- Click Download GeoJSON (.geojson) to save the file, or click Copy GeoJSON to paste it directly into your code or map tool.
Practical Tips for KML and GeoJSON Files
- Use 6 decimals (~0.1m) for most web maps; it keeps file sizes smaller without losing street-level accuracy.
- Leave Keep Altitude (Z) unchecked unless you specifically need 3D elevation values in your GeoJSON coordinates.
- If your Google My Maps export is a
.kmzarchive, unzip it on your computer first to extract thedoc.kmlfile inside, then drop that file here. - Uncheck Pretty-Print JSON before downloading large polygon layers to produce compact single-line JSON that loads faster on websites.
Frequently asked questions
Are my KML map files uploaded to a server?
No. All XML parsing, coordinate conversion, and geometry rendering run locally inside your browser using JavaScript, so your files stay completely private.
Does this converter support Polygons with inner holes and MultiGeometry?
Yes. Both outerBoundaryIs and innerBoundaryIs polygon rings are converted into GeoJSON Polygon coordinate arrays, and MultiGeometry blocks become GeoJSON GeometryCollection objects.
Are custom attributes in ExtendedData preserved?
Yes. Key-value pairs inside <ExtendedData> (<Data> and <SimpleData> tags) are automatically copied into each feature's properties object alongside name and description.
Can I convert KMZ files directly here?
A .kmz file is a compressed ZIP archive containing a doc.kml file. Rename or extract the .kmz with any unzip tool, then upload the extracted .kml file.
Does it follow the RFC 7946 GeoJSON standard?
Yes. Coordinates are ordered as [longitude, latitude] numbers and wrapped in a standard FeatureCollection compatible with Leaflet, Mapbox, QGIS, and geojson.io.
Comments
Post a Comment