What Is KML?
KML (Keyhole Markup Language) is an XML-based format for geographic data originally developed for Google Earth. It is widely used for sharing map data with Google Earth, Google Maps, and other mapping applications that support the OGC KML standard.
Mapping Features Onto Placemarks
Paste your GeoJSON and the tool converts it to valid KML. Each GeoJSON Feature becomes a KML Placemark. Geometry types are mapped directly: Point to Point, LineString to LineString, Polygon to Polygon. Feature properties are included as ExtendedData elements in the KML output.
Note that GeoJSON uses [longitude, latitude] coordinate order while KML uses longitude,latitude (comma-separated, no space). The converter handles this automatically.
GeoJSON vs. KML
| Feature | GeoJSON | KML |
|---|---|---|
| Format | JSON | XML |
| File size | Compact | Larger (XML overhead) |
| Styling | Not built-in | Built-in (colors, icons, labels) |
| 3D support | Limited | Full (altitude, camera angles) |
| Web mapping | Native support | Requires parsing |
Who Still Asks for KML
- Sharing geographic data with Google Earth users
- Importing web mapping data into Google My Maps
- Distributing map data to stakeholders who use KML-based tools
- Archiving spatial data in an OGC-standard XML format
To convert in the other direction, use the KML to GeoJSON converter.
The Eiffel Tower as a Placemark
Paste this GeoJSON Point feature into the converter. The tool produces a KML Placemark with the same location and name:
GeoJSON{
"type": "Feature",
"properties": { "name": "Eiffel Tower" },
"geometry": {
"type": "Point",
"coordinates": [2.2945, 48.8584]
}
}The resulting KML output:
KML<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>GeoJSON Export</name>
<Placemark>
<name>Eiffel Tower</name>
<Point>
<coordinates>2.2945,48.8584</coordinates>
</Point>
</Placemark>
</Document>
</kml>KML coordinates are comma-separated with no spaces inside a triple. Two-dimensional GeoJSON positions are written as two values; an altitude appears only when your input carries a third ordinate. A name property becomes the KML <name> element, and the Document takes a fixed name of GeoJSON Export.
Inside the KML Writer
The converter walks the GeoJSON structure and maps each Feature to a KML Placemark inside a Document element. Coordinate arrays are reformatted from JSON arrays [lon, lat] to KML's lon,lat,alt string format. Properties named name or description are mapped to their native KML elements; all other properties are written as <ExtendedData> entries.
For background on how KML compares to GeoJSON and when each format is the right choice, see the GeoJSON Specification Guide. If you need to share your data with Google Earth, the Web Mapping Guide covers integration options.