KML vs KMZ — What's the Difference?

KML is an open XML format for geographic data, KMZ is its compressed variant (ZIP archive). They're essentially the same format with different properties.

Criteria KML KMZ
File sizeLargeCompact (ZIP)
Human-readable✓✗
Embedded resources✗✓
Google Earth✓✓
Easy sharing✗✓

When to use KML

When you need to edit XML manually, debug geocoding, or integrate into code.

When to use KMZ

For email sharing, Google Earth publishing, compact storage.

What is KML?

Example OpenStreetMap map exported to KML
KML: an OpenStreetMap map exported by osm2cdr.

KML (Keyhole Markup Language) was developed by Keyhole, the company behind Google Earth, which Google acquired in 2004. Google later handed it to the Open Geospatial Consortium, and KML 2.2 became an OGC standard in 2008.

A KML document is XML: placemarks with points, lines and polygons are organised in folders, each with a name, a description and optional ExtendedData attributes. Styles define icons, line widths and fill colours; altitude modes and extrusion let features rise above the ground; network links and ground overlays pull in external content.

Software that opens KML

Google Earth Pro and Google Earth on the web open KML with a double click or a drag; Google My Maps, QGIS, ArcGIS, Global Mapper, Marble and many mobile apps import it.

Where KML is strong

KML is built for presentation: a client can explore the data on a globe without GIS skills, click a feature to see its attributes and switch folders on and off. As text it is easy to generate, inspect and edit.

Limitations of KML

It supports only WGS 84, files grow quickly because XML is verbose, and styling is limited to what Google Earth understands. It is a poor fit for analysis: attribute schemas are loose, and large datasets slow the viewer down.

What osm2cdr puts into a KML file

osm2cdr places each layer in its own folder, keeps the OSM tags of every feature in ExtendedData and gives lines and fills a colour and width. Roads, water and greenery lie on the ground, while buildings are extruded to the height from their tags, so Google Earth shows a three-dimensional city straight away.

What is KMZ?

Example OpenStreetMap map exported to KMZ
KMZ: an OpenStreetMap map exported by osm2cdr.

KMZ is the zipped form of KML, defined in the same OGC KML specification and handled natively by Google Earth. It exists for a practical reason: XML compresses very well, and one archive can carry the document together with the icons and images it refers to.

Open a KMZ with any archive tool and you will find doc.kml at the root plus optional folders with images, icons or 3D models referenced by relative paths. Everything KML can describe — placemarks, folders, styles, extruded buildings — works exactly the same inside the archive.

Software that opens KMZ

Google Earth Pro, Google Earth on the web, Google My Maps, QGIS, ArcGIS and Global Mapper read KMZ without unpacking it; Garmin devices accept KMZ files as custom maps when they contain image overlays.

Where KMZ is strong

Files are usually several times smaller than the same KML, they travel safely by email or messenger as a single attachment, and embedded resources cannot get separated from the document.

Limitations of KMZ

The content cannot be read or edited in a text editor without unzipping it first, and some web tools and older converters accept only plain KML. Compression does not make a large dataset any faster to display.

What osm2cdr puts into a KMZ file

osm2cdr builds the same document as its KML export — layers in folders, OSM tags in ExtendedData, WGS 84 coordinates, buildings extruded by their tagged heights and the other layers lying on the ground — and packs it into one compact KMZ.

Key differences explained

At the most basic level, KML is an XML format for showing geographic data on a virtual globe, while KMZ is a ZIP-compressed KML package. On disk, KML is plain XML text; KMZ is a ZIP archive with doc.kml and optional images.

Here is what the comparison table above means in practice, point by point:

Example OpenStreetMap map exported to Garmin Custom Maps KMZ
A related export: the same kind of map in Garmin Custom Maps KMZ, a format often used next to KML.

In short: choose KML when the result is shown on a globe to a client, colleagues or students. Choose KMZ when the globe view has to travel by email or messenger as one small attachment.

KML or KMZ: which one fits your job?

You are emailing a client a proposed delivery zone with the surrounding buildings to explore in Google Earth. KMZ is the better attachment: it is much smaller, arrives as one file and opens with a double click.

You generate placemarks with a script and want to check what is inside or adjust a style by hand. KML is plain XML, so you can open it in any text editor, compare two versions and fix a colour without extra tools.

You are uploading the data to a web tool or an older converter. Some of them accept only plain KML, so having the uncompressed version saves you a failed import and a confusing error message.

Pitfalls when switching between KML and KMZ

Renaming a .kmz to .kml does not work — the archive has to be unzipped, and the document inside is called doc.kml. When you repack a KML into KMZ yourself, icons referenced by absolute paths on your computer are not included, so the recipient sees missing images. The good news is that osm2cdr's two exports carry identical content, so switching between them never loses OSM tags, folders or building heights.

If a mail server blocks the attachment, a KMZ inside a cloud link is the most reliable way to share the globe view.

Which to pick on osm2cdr

On osm2cdr, pick KMZ when the file travels — by email, messenger or cloud link. Pick KML when you plan to edit, inspect or post-process the document, or when the receiving tool insists on uncompressed KML. Both open in Google Earth with the same three-dimensional city.

How to get KML or KMZ from OpenStreetMap

osm2cdr builds KML and KMZ directly from OpenStreetMap data — there is no need to download raw OSM extracts or install conversion tools. The steps:

  1. Open the osm2cdr map for KML and find your place by name, or draw a rectangle around the area.
  2. Choose KML or KMZ in the format list and set the options offered for it, such as map layers, style or sheet size.
  3. Start the export and download the result: KML arrives as a .kml file; KMZ arrives as a .kmz file.
  4. Need KMZ as well as KML? Run a second export of the same area. Both start from the same OpenStreetMap data, but each keeps only what its format can hold, as described in the sections on KML and KMZ above.

Converter pages related to KML and KMZ explain each route in more detail:

Frequently asked questions

What is the main difference between KML and KMZ?

KML is an XML format for showing geographic data on a virtual globe, whereas KMZ is a ZIP-compressed KML package. In the comparison table, KML is ahead on human-readable; KMZ is ahead on embedded resources and easy sharing.

Which is better for human-readable, KML or KMZ?

KML. KML is built for presentation: a client can explore the data on a globe without GIS skills, click a feature to see its attributes and switch folders on and off.

When does KMZ beat KML?

When embedded resources and easy sharing matter most. Files are usually several times smaller than the same KML, they travel safely by email or messenger as a single attachment, and embedded resources cannot get separated from the document.

Can I convert KML to KMZ?

There is no dedicated KML-to-KMZ converter page on osm2cdr. Both formats are exported directly from OpenStreetMap data: select an area once and run the export for each format you need.

Which programs open KML and KMZ files?

KML files open in Google Earth, Google My Maps, QGIS, ArcGIS and Global Mapper. KMZ files open in Google Earth, Google My Maps, QGIS, ArcGIS and Global Mapper.

Do KML and KMZ keep real-world coordinates?

KML always uses WGS 84 longitude, latitude and optional altitude, so features land in the right place in Google Earth without any setup. KMZ holds an ordinary KML document, so its coordinates are WGS 84 longitude, latitude and altitude as well.

Export to KML Export to KMZ