Convert KML to GeoJSON
Free, private and fast: everything runs in your browser and your KML file is never uploaded.
KML to GeoJSON: why convert
KML is what you get out of Google Earth and Google My Maps. GeoJSON is what web maps, JavaScript libraries and most APIs expect. Converting lets you put Google Earth placemarks, paths and areas on a Leaflet or MapLibre map, load them into a database such as PostGIS, or commit them to GitHub, which previews GeoJSON as a map. Drop your KML file below and the conversion runs entirely in your browser with GDAL, the same engine QGIS uses.
How to convert KML to GeoJSON
- Drop your .kml file in the box, or click to choose it.
- Check the preview on the map and the list of layers and features.
- Click Convert and download your GeoJSON file.
What changes when you convert
Styles are dropped
Colors, line widths and icons are part of KML but not of the GeoJSON standard, so they are not carried over. If you need styling in a web map, set it in your map code based on a property such as the placemark name or folder.
Each folder becomes its own layer
GeoJSON has no folders. When your KML has several folders, each folder is converted to its own GeoJSON file and you download them together as a .zip, named after the folders.
Names and descriptions become properties
The placemark name and description are kept as the properties "Name" and "Description". Descriptions written as HTML in Google Earth stay as HTML text. Values from ExtendedData become separate properties.
Altitude is kept
KML coordinates can include altitude. It is kept as a third coordinate in GeoJSON. Most web maps ignore it, so it does no harm.
No reprojection needed
Both KML and GeoJSON use WGS84 longitude and latitude, so your coordinates are not changed, only written with up to 7 decimals (about 1 cm).
About the formats
KML
KML (Keyhole Markup Language) is the XML format behind Google Earth and Google My Maps, and an OGC standard since 2008. Besides geometry it can hold styles, icons, folders and descriptions in HTML.
- Always WGS84 longitude, latitude and optional altitude.
- Folders group placemarks; each folder can become its own layer when converting.
- Styles (colors, line widths, icons) are specific to KML and Google Earth.
GeoJSON
GeoJSON is a plain-text JSON format for geographic features, standardized as RFC 7946 in 2016. It is the native format of web maps such as Leaflet, MapLibre and Mapbox, and of many APIs.
- Coordinates are WGS84 longitude, latitude (in that order).
- Points, lines and polygons can be mixed in one file.
- Properties can be any JSON value, with no limit on field name length.
Frequently asked questions
Is my KML file uploaded to a server?
No. The file is read and converted by your own browser. Nothing is sent anywhere, which also makes the converter safe for confidential data.
Can I convert a KMZ file?
Yes, use the KMZ to GeoJSON converter. A KMZ is a zipped KML, and the converter unpacks it for you.
Why did I get a .zip instead of one GeoJSON file?
Your KML has more than one folder. Each folder becomes its own GeoJSON file so the structure is not lost. If you want everything in one file, move all placemarks into one folder in Google Earth first.
Are network links followed?
No. Network links point to data on another server, which is not downloaded. Open the linked file in Google Earth and save it as KML first.