GeoJSON ↔ KML Converter
Convert between GeoJSON and KML instantly in your browser. Supports all geometry types, feature properties, file upload, and drag-and-drop. No data leaves your device.
Drag & drop a file onto the text area, or paste your data directly.
What This Tool Does
Bidirectional conversion between the two most common open geospatial file formats.
How to Use This Tool
Logic Behind the Tool
How each format is parsed and mapped to the other.
JSON.parse(). The tool accepts a FeatureCollection, a single Feature, or a bare geometry object. Each feature's geometry drives the KML element type, and properties are written as <ExtendedData> key-value pairs, with name and description hoisted to top-level KML elements.DOMParser in text/xml mode. Each <Placemark> becomes a GeoJSON Feature. Geometry is detected by querying child element names. <ExtendedData> and <SimpleData> elements are mapped to GeoJSON properties. Styles, folders, and network links are intentionally ignored.[longitude, latitude, altitude?] order — the opposite of the common "lat, lng" convention. KML uses longitude,latitude,altitude (comma-separated, no spaces). The tool correctly maps between both without swapping values. Altitude defaults to 0 in KML output when the GeoJSON coordinate has only two elements.Frequently Asked Questions
GeoJSON is a JSON-based open standard for encoding geographic data. It supports Points, LineStrings, Polygons, and their Multi- variants, wrapped in Feature and FeatureCollection objects. Each feature carries a properties object with arbitrary key-value data. GeoJSON is the dominant format for web mapping APIs — it's used natively by Leaflet, Mapbox, Turf.js, GitHub map rendering, and countless REST APIs.
KML (Keyhole Markup Language) is an XML-based format developed by Keyhole Inc. (acquired by Google in 2004) and is the native format for Google Earth and Google Maps (My Maps). It's an OGC standard since 2008. Use KML when you need to import data into Google Earth, share layered map data with styling (colors, icons), or work with older GIS tools that don't support GeoJSON. For modern web APIs, GeoJSON is usually the better choice.
GeoJSON follows the mathematical convention of [x, y] = [easting, northing] = [longitude, latitude]. This is consistent with how coordinates work in most CRS (coordinate reference systems) where x is the horizontal axis. KML and many consumer applications use the more human-friendly [latitude, longitude] order. This inconsistency is a well-known "gotcha" in GIS — this tool handles the mapping correctly in both directions without any manual reordering.
Yes. In GeoJSON, a Polygon with holes has multiple rings in its coordinates array — the first is the outer boundary, the rest are inner boundaries (holes). In KML, these map to <outerBoundaryIs> and one or more <innerBoundaryIs> elements. The converter correctly maps both directions, preserving any number of holes in polygons.
GeoJSON: Leaflet, Mapbox GL JS, OpenLayers, QGIS, ArcGIS, GitHub (automatic map preview), geojson.io, VS Code with Geo Data Viewer extension. KML: Google Earth, Google Maps (My Maps import), QGIS, ArcGIS, Esri ArcMap, Global Mapper, OziExplorer, most Garmin/GPS device software. Both formats are supported by GDAL/OGR, which is the underlying converter library in most professional GIS tools.