# 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.

Open the tool: https://spatibase.com/tools/kmz-to-kml/

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.

## What it does
- Extract the KML from a KMZ, unchanged
- Works with KMZ files from Google Earth, Google My Maps and ArcGIS
- Map preview of the places, lines and areas inside
- Also converts the KMZ to GeoJSON and CSV
- No renaming to .zip, no unzip tool needed
- Runs in the browser: nothing is uploaded

## 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.

## Formats and limits
- **Opens:** .kmz or .kml, up to 50 MB. Other map files (KML, KMZ, GPX, GeoJSON, shapefile, CSV) convert too.
- **Downloads:** KML, GeoJSON, CSV of the same features.
- **Privacy:** the file is read in your browser and never uploaded.
- Try it with a sample: https://spatibase.com/tools/kmz-to-kml/?sample=1
- Download the sample file (the one Open a sample opens): https://spatibase.com/tools/samples/barcelona.kmz

## What you get when you unzip a KMZ
| What | What happens |
|---|---|
| Placemarks, lines and areas | All of them, exactly as they were: it’s the same KML file. |
| Styles, folders and HTML descriptions | Unchanged. Nothing in the KML is rewritten. |
| Icons and images by web address | Still work, because they load from the internet. |
| Icons and photos packed in the KMZ | Not included. The KML still names them (often `files/…`), but the files aren’t next to it any more. |
| Extra .kml files in the archive | Only one comes out: `doc.kml` at the top level, or the first .kml when there is none. |

## 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.

## Extract the KML from a KMZ on the command line
A KMZ is an ordinary zip file, so the standard unzip tool does it:

```bash
# 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.

## Frequently asked questions
### 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.

## Next step
Turn the file into a live map your team can edit: **Save to Spatibase (free)** on the page saves it to a free Spatibase project (https://app.spatibase.com/signup), your places on a map you can edit and a live GeoJSON address for your site. Or download the GeoJSON and import it by hand (https://spatibase.com/docs/content/import/).
