# KML — Keyhole Markup Language

> KML (Keyhole Markup Language): OGC-standard XML format for geographic features, styles and overlays, widely used with Google Earth. Specs, software and free sample files; convert KML to 39 formats online.

- Page: https://beta.mygeodata.cloud/formats/kml



## What is a KML file?

Keyhole Markup Language (KML) is an XML-based format for describing geographic features and their presentation in Earth browsers. It was created by Keyhole, Inc. and popularised by Google Earth after Google acquired the company. It became an Open Geospatial Consortium standard in 2008 with version 2.2. A KML document is a single UTF-8 text file. Its Placemarks carry Point, LineString, Polygon and MultiGeometry elements, organised into Documents and Folders together with styles, descriptions, time stamps and network links.

Coordinates are always longitude, latitude and optional altitude in WGS 84, so data in other reference systems must be reprojected. Attributes are stored through ExtendedData, either as free name–value pairs or as typed fields defined in a Schema. KML works well for sharing and visualisation, but it is verbose for large datasets. Styling and overlay elements are often lost when it is converted to other GIS formats.

KML files are usually exchanged between people who need to show locations, routes or areas on a map, often as exports from Google Earth or from GIS and GPS tools. Because the file is plain XML, it can be inspected in a text editor. Watch for icons, images or models that are referenced externally and may not travel with the file, and for styling that does not survive conversion.

### Technical details

| | |
|---|---|
| Full name | Keyhole Markup Language |
| Data type | Vector · GIS vector |
| File extension | .kml |
| Files | Single file |
| Media type | application/vnd.google-earth.kml+xml |
| Geometry types | Point, LineString, Polygon, GeometryCollection |
| Multiple layers | Yes |
| Mixed geometry in a layer | Yes |
| Attribute names | No length limit (UTF8) |
| Coordinate system | Always WGS 84 (EPSG:4326) |
| Converter support | Read & write |
| Typical software | Google Earth Pro, QGIS, ArcGIS Pro, GDAL/OGR, Global Mapper, GPSBabel |
| Specification | https://www.ogc.org/standards/kml/ |

### Specifications & references

- https://www.ogc.org/standards/kml/
- https://developers.google.com/kml/documentation/kmlreference
- https://gdal.org/en/stable/drivers/vector/libkml.html

### Sample KML files — free download

- [Places with icons and folders](https://beta.mygeodata.cloud/static/landing/samples/v1/kml/st-helena-places.kml) — 58 places of Saint Helena (20 settlements, 17 peaks, 21 points of interest) with name, category, elevation from Copernicus DEM and OSM id. Styled placemarks in folders (settlements, peaks, points of interest) with descriptions and ExtendedData. (35.1 kB, EPSG:4326)
- [Basemap (folders)](https://beta.mygeodata.cloud/static/landing/samples/v1/kml/st-helena-basemap.kml) — Multi-layer basemap of Saint Helena: island outline, land cover, waterways, 100 m contours, roads, Jamestown buildings and places. One KML folder per layer, styled lines and filled polygons. (791 kB, EPSG:4326)
- [Hike (timed track + waypoints)](https://beta.mygeodata.cloud/static/landing/samples/v1/kml/st-helena-hike.kml) — Hike from Jamestown up Jacob's Ladder to High Knoll Fort: 3.0 km, 513 track points (10 s) with elevation and time, 4 waypoints. The track is a gx:Track with a timestamp per point (time slider in Google Earth). (46.5 kB, EPSG:4326)

### Convert KML to other formats

- [KML to SHP](https://beta.mygeodata.cloud/converter/kml-to-shp)
- [KML to DXF](https://beta.mygeodata.cloud/converter/kml-to-dxf)
- [KML to GPX](https://beta.mygeodata.cloud/converter/kml-to-gpx)
- [KML to GeoPDF](https://beta.mygeodata.cloud/converter/kml-to-geopdf)
- [KML to KMZ](https://beta.mygeodata.cloud/converter/kml-to-kmz)
- [KML to XLSX](https://beta.mygeodata.cloud/converter/kml-to-xlsx)
- [KML to CSV](https://beta.mygeodata.cloud/converter/kml-to-csv)
- [KML to GeoJSON](https://beta.mygeodata.cloud/converter/kml-to-geojson)
- [KML to SVG](https://beta.mygeodata.cloud/converter/kml-to-svg)
- [KML to MapInfo](https://beta.mygeodata.cloud/converter/kml-to-mapinfo)
- [KML to WKT](https://beta.mygeodata.cloud/converter/kml-to-wkt)
- [KML to GPKG](https://beta.mygeodata.cloud/converter/kml-to-gpkg)
- [KML to MBTiles](https://beta.mygeodata.cloud/converter/kml-to-mbtiles)
- [KML to DGN](https://beta.mygeodata.cloud/converter/kml-to-dgn)
- [KML to TopoJSON](https://beta.mygeodata.cloud/converter/kml-to-topojson)
- [KML to GML](https://beta.mygeodata.cloud/converter/kml-to-gml)
- [KML to MIF](https://beta.mygeodata.cloud/converter/kml-to-mif)
- [KML to SQLite](https://beta.mygeodata.cloud/converter/kml-to-sqlite)

## Frequently asked questions

### What is the difference between KML and KMZ?

KML is a single plain-text XML file, while KMZ is a zipped package that normally contains a KML document together with the icons, images or models it references. Use KMZ when the resources must stay with the file.

### Why are my styles or icons missing after converting KML?

Most GIS formats have no equivalent for KML styles, overlays, network links or tours, so these elements are often dropped. Icons and images referenced externally can also be lost if the links are broken or the files are not included.

### Can a KML file contain several layers and attributes?

Yes. Features can be organised into Documents and Folders, which GIS software often reads as separate layers. Attributes are stored in ExtendedData as name–value pairs or as typed fields defined in a Schema.

### What is a KML file?

Keyhole Markup Language (KML) is an XML-based format for describing geographic features and their presentation in Earth browsers. It was created by Keyhole, Inc. and popularised by Google Earth after Google acquired the company. It became an Open Geospatial Consortium standard in 2008 with version 2.2. A KML document is a single UTF-8 text file. Its Placemarks carry Point, LineString, Polygon and MultiGeometry elements, organised into Documents and Folders together with styles, descriptions, time stamps and network links.

Coordinates are always longitude, latitude and optional altitude in WGS 84, so data in other reference systems must be reprojected. Attributes are stored through ExtendedData, either as free name–value pairs or as typed fields defined in a Schema. KML works well for sharing and visualisation, but it is verbose for large datasets. Styling and overlay elements are often lost when it is converted to other GIS formats.

### How do I open a KML file?

KML files can be opened in Google Earth Pro, QGIS, ArcGIS Pro, GDAL/OGR and Global Mapper. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert KML to?

Popular conversions are SHP, DXF, GPX, GeoPDF, KMZ and XLSX. In total the Converter writes KML data to 39 formats.

### How do I create a KML file?

Convert existing data to KML — for example from DWG, SHP, KMZ, DXF and GPX. Upload the file, choose KML as output and download the result.

### Which coordinate system does KML use?

KML always uses WGS 84 (EPSG:4326).

