Convert KML to GeoJSON
This free KML to GeoJSON converter turns placemarks, paths and areas from Google Earth or My Maps into GeoJSON for web maps, databases and code. The file is converted in your browser and is not uploaded. ExtendedData fields become properties, KML colors become simplestyle properties, network links are not followed, and a KML with several folders gives one GeoJSON file per folder in a zip.
Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.
Key facts
- Input: KML (.kml). Output: GeoJSON (.geojson).
- Your files are not uploaded: the work is done in your browser, on your own device.
- File size: no fixed limit; very large files are limited by your device's memory.
- Needs a current browser (Chrome, Edge, Firefox or Safari) on a computer, tablet or phone; nothing to install.
- Free to use, with no sign-up.
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
Colors become simplestyle properties
GeoJSON has no styles of its own. The colors of each placemark's icon, line and fill, including shared styles from My Maps and Google Earth, are therefore written as the simplestyle properties marker-color, stroke, stroke-width, stroke-opacity, fill, fill-opacity, which geojson.io, GitHub and Mapbox draw. Icon images are not carried over.
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. Extra fields stored as KML ExtendedData, such as the table columns of a My Maps layer or the attributes of a layer saved from QGIS, become properties of their own. Their values are text, unless the KML's schema declares a field as a number. KML from ArcGIS (Layer To KML, ArcGIS Online) usually keeps the attributes only as an HTML table in the description; each row of that table becomes a property too, numbers as numbers, while Description keeps the HTML for popups.
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.