KMZ to KML converter

Get the KML out of a KMZ file from Google Earth or Google My Maps, exactly as it is inside. Preview it on a map first. Free, and no account needed.

Drop a KMZ or KML file here

Download the sample

Your file stays on your computer: nothing is uploaded.

In short

Convert KMZ to KML online, in your browser

The Spatibase KMZ to KML converter takes the KML file out of a KMZ in your web browser and hands it over unchanged: every placemark, folder, style and description stays as it was. How it works:

  • The main KML. A KMZ is a zip archive; the converter picks the doc.kml at its top level, or the first .kml it finds when there is none.
  • Packed images stay behind. Images and icons in the KMZ aren’t extracted, so links to them in the KML no longer work.
  • Never uploaded. KMZ files up to 50 MB open with no account.
How to

How to convert KMZ to KML

  1. Find the .kmz. Google My Maps exports one by default (three-dot menu → Export to KML/KMZ), and Google Earth Pro saves one with Save Place As.
  2. Drop it on the box above, or press Choose a file. Try the sample to see a small Barcelona KMZ first.
  3. Check the map: these are the places inside. Click one to read its name and description.
  4. Press Download KML. You get the file that was inside the KMZ, ready for any app or text editor that reads KML.
What’s kept

What you get when you unzip a KMZ

WhatWhat happens
Placemarks, lines and areasAll of them, exactly as they were: it’s the same KML file.
Styles, folders and HTML descriptionsUnchanged. Nothing in the KML is rewritten.
Icons and images by web addressStill work, because they load from the internet.
Icons and photos packed in the KMZNot included. The KML still names them (often files/…), but the files aren’t next to it any more.
Extra .kml files in the archiveOnly one comes out: doc.kml at the top level, or the first .kml when there is none.
Formats

What is inside a KMZ file?

A KMZ is a zip. Google Earth packs one KML file, usually named doc.kml, with the pictures it uses (often in a files/ folder) and compresses them. The file is smaller, and photos and custom icons travel with the map.

Why get the KML out? Some apps and websites only read plain KML. And a KML is text: open it in any editor to check a coordinate, fix a name or compare two versions.

Other ways to unzip one, if you prefer:

  • Rename it. Change .kmz to .zip, open it and copy out doc.kml.
  • Use an unzip app. 7-Zip on Windows and The Unarchiver on a Mac open a .kmz without renaming.
  • Use Google Earth Pro. Right-click the layer under Places, choose Save Place As and set the type to Kml.

Keeping the pictures. If the KML links to images inside the KMZ, unzip the whole archive into one folder and keep the KML next to its files/ folder, so the relative links still work.

Do it in code

Extract the KML from a KMZ on the command line

A KMZ is an ordinary zip file, so the standard unzip tool does it:

# see what's inside
unzip -l places.kmz

# write the main KML to a file of its own
unzip -p places.kmz doc.kml > places.kml

The same in code:

  • Python: zipfile.ZipFile("places.kmz").extract("doc.kml") writes the main KML to a file.
  • JavaScript: unzipSync from fflate, the library this converter uses, returns every file in the archive as bytes.
FAQ

Questions about converting KMZ to KML

How do I open a KMZ file without Google Earth?

Drop it on this page: you see its places on a map and can download the KML inside. Because a KMZ is a zip file, you can also rename it to .zip and unzip it, or open it with 7-Zip.

Is anything lost when converting KMZ to KML?

Nothing in the KML itself: you get the file that was inside the KMZ, unchanged. What stays behind are the images and icons packed next to it, so placemarks that used them show a default pin.

Why is the KML bigger than the KMZ?

The KMZ is compressed. KML is text that repeats the same tags for every placemark, so it often zips to a third of its size or less. Unzipped, it takes its full space again.

My KMZ holds several KML files. Which one do I get?

The main one: doc.kml at the top of the archive, or the first .kml file when there is no doc.kml. To get all of them, rename the KMZ to .zip and unzip it.

How do I export KML instead of KMZ from Google My Maps?

In the export dialog (three-dot menu → Export to KML/KMZ), tick the box to export a .KML file instead of a KMZ. My Maps warns that some icons aren’t supported that way. Or export the KMZ and convert it here.

Moving the places into Spatibase? Read how to import your data. Need another pair of formats? The GIS file converter converts between all of them.

Talk to us

Not sure it’s a fit? Let’s find out

Tell us about your use case and what you need, from data model to security and deployment. In 30 minutes we’ll look at it together and tell you honestly if we can help.

Or write to hello@spatibase.com.