KML to GeoJSON Converter
Convert between KML/KMZ and GeoJSON formats bidirectionally
KML to GeoJSON Converter Online
This is a free, browser-based KML to GeoJSON converter that also handles the reverse direction β GeoJSON to KML β in a single tool. Drop a .kml or .kmz file in, see it rendered on a map, and download the converted GeoJSON. Or paste GeoJSON in and export it to KML for opening in Google Earth. Everything runs locally in your browser, so your KML files never leave your computer. If you've been searching for a private, free KML converter online, this is it.
KML (Keyhole Markup Language) is the XML-based format that Google Earth introduced and the OGC eventually standardised. It's still the most common way to share lightweight geographic data between non-GIS users β hikers exporting routes from Google My Maps, real estate agents marking up property lines, environmental groups marking sample sites. KMZ is a zipped KML, sometimes bundling icons and ground overlays. GeoJSON, by contrast, is the dominant format for web mapping libraries, JavaScript visualisation, and modern GIS tooling. Bridging the two is one of the most common conversions in everyday GIS work.
How KML and GeoJSON Differ
KML and GeoJSON describe similar things β points, lines, polygons, attributes β but they make different choices. KML is verbose XML with deeply nested elements, namespaces, and a rich style system that includes icons, labels, line widths, and balloon HTML. GeoJSON is compact JSON, focused purely on geometry and properties, with styling handled by the rendering library. KML always uses WGS84; GeoJSON also defaults to WGS84 since RFC 7946.
The converter walks the KML tree, extracts every Placemark, MultiGeometry, GroundOverlay (geometry only), Folder, and Document, and emits a corresponding GeoJSON Feature. KML extended data and simple data fields become GeoJSON properties. Style references are preserved as properties so downstream tools can recreate the original look if needed.
Going the Other Way
GeoJSON-to-KML is conceptually simpler: every Feature becomes a Placemark, every property becomes a SimpleData entry, and the output is wrapped in a Document/Folder structure. The tricky parts are deciding which properties to preserve and how to map any styling hints into KML's Style elements.
Key Features
Bidirectional Conversion
Full KML/KMZ to GeoJSON and GeoJSON to KML. Drop in either format and pick the destination.
KMZ Support
KMZ files are zipped containers. The converter unpacks them in memory, finds the doc.kml, and reads it directly. Embedded icons and overlays are listed but not extracted unless you ask.
Preserved Attributes
KML extended data, simple data, and balloon descriptions are mapped to GeoJSON properties so no information is lost in translation.
Multi-Geometry Handling
KML MultiGeometry elements containing mixed types are split into GeoJSON MultiPoint, MultiLineString, MultiPolygon, or GeometryCollection as appropriate.
Practical Applications
Google My Maps Migration
Users who built personal maps in Google My Maps and want to move them to a self-hosted Leaflet or MapLibre site export their data as KML. Converting to GeoJSON unlocks the full ecosystem of web mapping tools.
Field Survey Conversion
Field crews using mobile mapping apps that export KML β Avenza Maps, Locus Map, Maps.me β convert their KML data to GeoJSON for ingestion into ArcGIS Online, QGIS, or a custom database.
Real Estate and Property Data
Real estate professionals share property boundaries and points of interest as KML files because Google Earth is universally available. Brokers building modern web dashboards need GeoJSON instead.
Environmental Monitoring
NGOs tracking deforestation, illegal mining, or wildlife corridors often receive KML overlays from partner organisations. Converting to GeoJSON lets them feed the data into analytical pipelines and statistical tools.
Aviation and Flight Planning
Airspace boundaries, no-fly zones, and drone restriction areas are commonly published as KML by aviation authorities. Drone operators converting to GeoJSON can integrate the data into custom flight planning tools.
Education and Outreach
Teachers preparing classroom maps and students collecting data for geography projects use KML because Google Earth is free and ubiquitous. Converting to GeoJSON lets them publish interactive web maps that work without Google Earth.
Step-by-Step Workflow in gis.tools
- Open the KML to GeoJSON Converter page.
- Drag your
.kmlor.kmzfile (or paste the XML directly) into the input area. - The converter parses the XML and renders the features on the preview map.
- Inspect the attribute table to verify properties carried over correctly.
- Click Download GeoJSON to save the result, or click Switch to KML output if you started from GeoJSON.
- For GeoJSON-to-KML, paste or drop GeoJSON, then download the resulting
.kml.
Worked Example
A backcountry guide has a KMZ file with 240 hut locations, 180 km of trail centrelines as LineStrings, and a single MultiPolygon describing the park boundary. They drop it in, convert to GeoJSON, and notice that one LineString crosses the international dateline β a common gotcha that the GeoJSON spec expects to be split into two pieces. They use the GeoJSON Validator & Fixer to detect and repair the issue, then drop the cleaned GeoJSON into a MapLibre GL JS map for their booking site. The whole process takes under five minutes, and the original KMZ never left their laptop.
Common Pitfalls and Gotchas
- NetworkLinks β KML can reference remote KML resources via NetworkLinks. The converter cannot follow them due to browser CORS, so any data behind a NetworkLink will be missing.
- Time-stamped features β KML's TimeStamp and TimeSpan elements have no GeoJSON equivalent. They get stored as properties but lose their first-class meaning.
- 3D geometries β KML supports altitude with
clampToGround,relativeToGround, andabsolutemodes. The converter preserves Z coordinates but discards the altitude mode. - Style references β KML styles defined in the Document and referenced by Placemarks are flattened to property strings, not full style objects.
- Antimeridian crossing β A LineString that crosses 180Β° longitude is allowed in KML but problematic in GeoJSON, which requires splitting at the dateline.
- Special characters in CDATA β KML descriptions often contain HTML wrapped in CDATA. The converter preserves it as a string, but downstream tools may need to escape it.
- Mixed coordinate orders β KML uses lon,lat,alt while many user-edited KML files mistakenly use lat,lon. The converter assumes the spec-compliant order.
Tips for Best Results
- For KMZ, make sure the archive is a true ZIP (not a renamed file).
- Verify the bounding box on the rendered map matches the country or region you expect.
- After conversion, run the result through the GeoJSON Validator & Fixer to catch antimeridian issues, ring winding errors, or coordinate precision problems.
- If you need to preserve KML-specific styling for round-tripping, export both the GeoJSON and the original KML.
- Use the Coordinate Precision Reducer to shrink the GeoJSON output before publishing it on the web.
Comparison with Other GIS Approaches
The canonical KML-to-GeoJSON converter is Mapbox's togeojson library, which powers many web tools. QGIS can import KML and export to GeoJSON via Save Features As, but the round trip strips some KML-specific styling. Google Earth itself can save KML/KMZ but cannot export GeoJSON. Online services like MyGeodata Cloud and AnyConv route the file through their servers β fast but not private. The browser-based gis.tools converter sits at the intersection of speed, privacy, and zero installation, with the trade-off being a soft file size cap of around 100 MB depending on browser memory.
Performance Considerations
KML is verbose XML, so a file with 100,000 features can balloon to hundreds of megabytes on disk. Browser parsing handles a few hundred thousand features comfortably; beyond that, switch to a desktop tool. KMZ is more efficient because the XML is gzipped, but the converter still has to inflate it in memory.
Data Privacy and Browser-Based Processing
Everything stays on your device. No uploads, no telemetry, no logs. This matters when your KML contains sensitive locations β research field sites, wildlife sightings, security-sensitive infrastructure β that you would not put on a public conversion website.
Related GIS Concepts
togeojson β Mapbox's open-source JavaScript library that defined the de facto standard for KML/GPX-to-GeoJSON conversion in the browser.
OGC KML 2.3 β The current OGC standard for KML, which formalised what had been a Google-internal format. Most KML in the wild is older 2.2 from Google Earth.
ExtendedData β KML's mechanism for attaching arbitrary attributes to a Placemark. The converter maps these directly to GeoJSON properties.
Frequently Asked Questions
Can I convert KMZ files directly?
Yes. KMZ is just a zipped KML. The converter unpacks it in memory and reads the doc.kml inside.
Will styling and icons be preserved?
KML styles are mapped to GeoJSON properties, but icons and colours are not first-class GeoJSON concepts. You'll need to recreate the styling in your map's renderer.
What about the description balloons?
They're stored in the GeoJSON properties.description field as HTML strings.
Can I convert GeoJSON to KML for Google Earth?
Yes β paste or drop a GeoJSON file and switch to KML output mode.
Why are some of my features missing after conversion?
Likely a NetworkLink that the browser cannot follow. Check the original KML for NetworkLink elements and download those resources separately.
Related Tools on gis.tools
Related Tools
View All ToolsGeoJSON to TopoJSON Converter
Convert between TopoJSON and GeoJSON with topology preservation
Import & ExportGeoTIFF Tiles Preview
Preview GeoTIFF as PNG tiles with client-side tiling
Import & ExportGeoJSON, KML, Shapefile & GIS File Viewer
Drag-and-drop loader for GeoJSON, KML, GPX, CSV, Shapefile, and GeoTIFF files
Import & ExportAttribute Table Exporter
Export feature attributes to CSV or Excel format
Import & ExportMap Style Converter
Convert between Mapbox style JSON and simplified style schemas
Import & ExportCSV to Points Layer
Build a points layer from CSV with latitude/longitude columns
Import & Export100% client-side processing - your data stays private and never leaves your device