OmniConvert

KML and KMZ Files: Google Earth Format Explained

KML (Keyhole Markup Language) is the XML format behind Google Earth. It was created by Keyhole, the company Google bought in 2004 to build Google Earth, and became an OGC standard in 2008. KML stores places, paths and areas together with their names, descriptions and styling.

KMZ is simply a ZIP-compressed KML file, often bundled with the icons and images it uses.

Example: A KML file with one placemark
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <Placemark>
      <name>Brandenburg Gate</name>
      <description>Landmark in Berlin</description>
      <ExtendedData>
        <Data name="built"><value>1791</value></Data>
      </ExtendedData>
      <Point>
        <coordinates>13.377704,52.516275,0</coordinates>
      </Point>
    </Placemark>
  </Document>
</kml>

Convert KML / KMZ files

How a KML file is structured

Coordinates are always WGS 84 and written as longitude,latitude[,altitude], with longitude first. Swapping the order is the most common reason a hand-made KML shows up in the wrong place.

  • Document and Folder: group placemarks, like folders in Google Earth's sidebar
  • Placemark: one feature with a name, description and geometry
  • Point, LineString and Polygon: the geometries; polygons have an outerBoundaryIs and optional innerBoundaryIs rings for holes
  • MultiGeometry: several geometries in one placemark
  • ExtendedData: custom attributes such as IDs or population
  • Style: colors, line widths and icons

KML vs KMZ

A KMZ file is a ZIP archive containing a main file named doc.kml, plus any images or icons it references. It is smaller and keeps everything together, which makes it better for sharing. Google Earth and Google My Maps open both. To edit the contents, rename .kmz to .zip and extract it, or convert it to KML.

How to open a KML or KMZ file

  • Google Earth Pro or Google Earth on the web: File → Open, or Projects → Import
  • Google My Maps: Import into a layer
  • QGIS and ArcGIS
  • Any text editor, for KML

Frequently Asked Questions

What is the difference between KML and KMZ?
KMZ is a zipped KML file, optionally with images and icons. The map data is the same; KMZ is just smaller and self-contained.
How do I use a KML file in QGIS or ArcGIS?
Both can open KML directly. For editing or analysis, many GIS workflows convert KML to a shapefile or GeoJSON first, which keeps the attributes as regular table columns.

More format guides