Converting KML to GeoJSON
This tool parses KML (Keyhole Markup Language) data and converts it to GeoJSON format. KML Placemarks become GeoJSON Features, and KML geometry elements (Point, LineString, Polygon, MultiGeometry) are mapped to their GeoJSON equivalents.
Simply paste your KML content into the input panel. The converted GeoJSON is displayed in the result panel and visualized on the map.
KML<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>Empire State Building</name>
<Point>
<coordinates>-73.9857,40.7484,0</coordinates>
</Point>
</Placemark>
</kml>What Gets Converted
- Placemarks — converted to GeoJSON Features with geometry and properties
- Coordinates — reordered from KML's
lon,lat,altto GeoJSON's[lon, lat]array format - Names and descriptions — preserved as Feature properties
- MultiGeometry — converted to appropriate Multi-type GeoJSON geometries
- ExtendedData — included in Feature properties when available
Limitations
KML features that do not have direct GeoJSON equivalents are not converted:
- Styling information (colors, icons, line widths) — GeoJSON has no built-in styling
- Ground overlays and screen overlays — image-based features
- 3D altitude data — GeoJSON supports elevation but many consumers ignore it
- Network links and dynamic content — GeoJSON is a static format
To convert in the other direction, use the GeoJSON to KML converter.
Try It
Paste this KML containing a Placemark for the Sydney Opera House. The converter produces a GeoJSON Feature with the name preserved as a property:
KML<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Sydney Opera House</name>
<description>Iconic performing arts venue</description>
<Point>
<coordinates>151.2153,-33.8568,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>The resulting GeoJSON output:
GeoJSON{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "Sydney Opera House",
"description": "Iconic performing arts venue"
},
"geometry": {
"type": "Point",
"coordinates": [151.2153, -33.8568]
}
}
]
}The altitude value (0) is dropped since the GeoJSON output uses 2D coordinates. The KML <name> and <description>elements become properties on the Feature.
How the Conversion Algorithm Works
The converter parses the KML XML document and extracts every Placemark element. Each Placemark's geometry is read from its child element (Point, LineString, Polygon, or MultiGeometry) and converted to the equivalent GeoJSON geometry type. KML coordinate strings (lon,lat,alt) are split and restructured into JSON arrays.
After conversion, you can view the result on a map, validate it against RFC 7946, or process it with any of the other GeoJSON tools. For more on the GeoJSON format and its rules, see the GeoJSON Specification Guide.