Convert KML to GeoJSON
Turn a Google Earth KML into GeoJSON for web maps, APIs and modern GIS. ExtendedData fields become properties with their real names (no 10-character limit), and KML styling is preserved as simplestyle properties that Leaflet and Mapbox draw from directly.
Drop your KML here
or
Your file is converted inside this tab and never uploaded. No size limit, no sign-up.
What happens to your data
KML and GeoJSON store different things, so some parts of your file translate exactly and others cannot. Here is the whole picture before you convert, rather than after.
Attribute namesKept
GeoJSON properties have no length limit, so measured_elevation_metres stays exactly that rather than being cut to ten characters as a shapefile would.
Points, lines and areasKept
A FeatureCollection holds every geometry type together, so a mixed KML stays one file instead of splitting into separate layers.
StylingChanged
Colours, line widths and icons become simplestyle properties (stroke, fill, stroke-width), which Leaflet, Mapbox and GitHub render without extra work.
Names and descriptionsKept
Placemark names and descriptions become ordinary properties alongside your ExtendedData fields.
ElevationKept
Altitudes stay as the third value in each coordinate, which is exactly how GeoJSON stores them.
Coordinate systemKept
Both formats are WGS 84 longitude and latitude, so coordinates pass through untouched with no reprojection.
FoldersNot carried over
GeoJSON is a flat list of features with no folder concept. Everything ends up in one collection.
How to convert KML to GeoJSON
- 1
Choose your KML file
Drag a .kml onto the box above. The file stays on your computer; nothing is uploaded.
- 2
Convert
Placemarks become features, ExtendedData becomes properties, and the whole thing is written as a FeatureCollection.
- 3
Download the GeoJSON
You get one .geojson file, formatted readably so you can open it in an editor and see what is there.
- 4
Use it
Load it into Leaflet or Mapbox, commit it to a repository, post it to an API, or drag it into QGIS.
GeoJSON is the format the web actually reads
Every modern mapping library takes GeoJSON directly: Leaflet, Mapbox GL, OpenLayers, deck.gl, D3. So do PostGIS, QGIS, ArcGIS and most spatial APIs. It is plain JSON, so any language can read it without a geospatial library at all.
That is the real reason to convert out of KML. KML is built for Google Earth, and support elsewhere ranges from partial to absent. GeoJSON goes everywhere, and a browser can parse it with JSON.parse.
No 10-character limit on your column names
If you have converted KML to a shapefile before, you will have met the 10-character cap on attribute names, a legacy of the dBASE format shapefiles still use for their attribute table.
GeoJSON has no such limit. A property called total_station_measured_elevation stays exactly that. Property names are also case-sensitive and can hold any character, so nothing has to be sanitised. If your attribute names matter, this is the better target.
Styling survives, as simplestyle
KML stores colours and line widths in Style elements. GeoJSON has no official styling, but there is a widely used convention, simplestyle, that puts stroke, stroke-width, stroke-opacity, fill and fill-opacity in a feature's properties.
Your KML styling is converted into those properties. GitHub renders them automatically when you commit a .geojson file, and Leaflet and Mapbox need only a few lines to read them. This is a genuine advantage over converting to a shapefile, which drops styling entirely because it has nowhere to put it.
A note on coordinate order
GeoJSON stores coordinates as longitude first, then latitude. This trips people up constantly, because most of us say and write latitude first.
KML uses the same longitude-first order, so nothing has to be swapped here. But if you are hand-writing GeoJSON or comparing against a spreadsheet of lat/lon pairs, remember that the order is reversed from how you would read it aloud. A map where everything appears in the sea off West Africa is the classic sign of a swap.
Nothing is uploaded
The conversion is JavaScript running in this tab. Your KML is read locally, converted in memory and handed back as a download, so there is no size limit and no copy of your data on a server.
KML and GeoJSON, briefly
KMLKeyhole Markup Language
The XML format Google Earth uses. One readable text file that holds points, lines and polygons together with their names, descriptions and colours.
GeoJSONGeoJSON
The web's geospatial format: plain JSON that every mapping library, API and modern GIS reads directly. Always in WGS 84 longitude/latitude.
Questions people ask
Is this KML to GeoJSON converter free?
Yes, with no sign-up, no watermark and no limit on file size or how many files you convert. The conversion runs in your browser rather than on a server, so there is nothing to meter.
Is my KML uploaded anywhere?
No. The file is read and converted entirely inside your browser tab and nothing is transmitted or stored. You can verify this by disconnecting from the internet after the page loads and converting a file anyway.
Does KML styling survive the conversion to GeoJSON?
Yes, as simplestyle properties. Colours, line widths and opacity from your KML Style elements become stroke, stroke-width, stroke-opacity, fill and fill-opacity on each feature. GitHub renders those automatically, and Leaflet and Mapbox read them with a few lines of code. This is one reason to choose GeoJSON over a shapefile, which cannot store styling at all.
Why is longitude before latitude in GeoJSON?
The GeoJSON specification defines position as longitude, then latitude, then optional elevation: x, y, z in mathematical order. KML uses the same order, so nothing is swapped during conversion. The confusion arises because people say and write latitude first. If your points appear in the Gulf of Guinea, the coordinates have been swapped somewhere.
Will my ExtendedData fields become properties?
Yes. Every ExtendedData field becomes a property with its original name, and placemark names and descriptions become properties too. Unlike a shapefile, GeoJSON places no limit on property name length, so nothing needs shortening.
Can GeoJSON hold points, lines and polygons in one file?
Yes. A FeatureCollection can hold any mix of geometry types, so a KML containing markers, paths and areas converts to a single GeoJSON file. A shapefile cannot do this, which is why converting the same KML to a shapefile produces several layers.
What coordinate system is the GeoJSON in?
WGS 84 longitude and latitude, which RFC 7946 requires of all GeoJSON. KML uses the same system, so coordinates pass through unchanged with no reprojection and no rounding.
My file is a KMZ. Can I convert that to GeoJSON?
Yes. Use the universal converter and choose GeoJSON as the output. A KMZ is just a zipped KML, so the archive is opened and its contents converted the same way.
Other conversions
Need a combination that is not listed? The universal converter handles every format this tool reads and writes.