What is the KML file format?
A .kml file contains geographic data saved in an XML-based format. KML files can store information about:
- Points,
- Lines and paths,
- Polygons,
- Images and overlays,
- 3D models,
- Text descriptions and HTML pop-ups.
Data stored in .kml files is used for marking and describing geographical locations, adding camera viewpoints, or layering overlay textures on maps. Each location is described by its coordinates (latitude and longitude) following the WGS84 standard, and optionally with a third coordinate - altitude above mean sea level, which defaults to 0. A camera view or time span can also be defined. .kml shares structural similarities with the GML format.
.kml files are commonly distributed as .kmz archives - ZIP-compressed packages that bundle the .kml document together with any referenced images or models. The name Keyhole Markup Language derives from Keyhole, Inc., the company that originally developed the format. Google acquired Keyhole in 2004 and integrated the technology into Google Earth, enabling both offline and online viewing and editing of .kml data. In 2008, the Open Geospatial Consortium (OGC) standardized KML 2.2 as an open format for geo-browsers.
Security & safety
RISK: LOWKML is plain XML with no executable code, so the file itself is safe to open. Two things to be aware of: a <NetworkLink> element can make a KML automatically fetch remote content from a URL when opened (a privacy/tracking vector and, in theory, a way to pull in unexpected data) - be cautious with KML from untrusted sources. Also, map data can be privacy-sensitive: a shared route or set of pins can reveal a home address or regular movements. KMZ files are ZIP archives, so the usual advice about only unzipping trusted archives applies.
Format details
in a nutshellPrograms that open KML files
Technical details
deep spec| MIME type | application/vnd.google-earth.kml+xml |
| File encoding | Plain UTF-8 XML text; no binary header or magic bytes |
| XML root element | `<kml>` with namespace `xmlns="http://www.opengis.net/kml/2.2"` |
| Coordinate system | WGS84 (EPSG:4326) - longitude, latitude, optional altitude in metres |
| Coordinate order | Longitude before latitude (opposite to the ISO 6709 / GeoJSON convention) |
| Altitude modes | `clampToGround`, `relativeToGround`, `absolute` |
| Geometry types | Point, LineString, LinearRing, Polygon, MultiGeometry, Model |
| Styling system | Inline `<Style>` and shared `<StyleMap>` elements control icon, color, line width, and label |
| Time elements | `<TimeStamp>` for a single instant; `<TimeSpan>` for an interval - enables temporal animation in geo-browsers |
| Overlay types | GroundOverlay (image on terrain), ScreenOverlay (HUD graphic), PhotoOverlay (360° photo) |
| Network links | `<NetworkLink>` fetches remote KML/KMZ data dynamically, enabling live-updated map layers |
| 3D model references | References external COLLADA (`.dae`) files via `<Model>` element for 3D objects placed on terrain |
| Compressed variant | `.kmz` - a ZIP archive bundling the `.kml` file with referenced images and models |
| Standardizing body | Open Geospatial Consortium (OGC); KML 2.2 standardized April 2008 (document OGC 07-147r2) |
| Balloon pop-ups | `<description>` field accepts plain text or HTML, displayed as an info balloon on feature click |
| Released | 2004 (Google acquired Keyhole); KML 2.2 adopted as an OGC standard in 2008 |
| Open standard | Yes · royalty-free |
| Specification | www.ogc.org |
KML conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about KML files.