# KMZ to GPX converter

> Turn a KMZ file from Google My Maps or Google Earth into a GPX file your GPS watch, bike computer or hiking app can follow. No unzipping, free, and no account needed.

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

**From a .kmz straight to GPX 1.1.** The Spatibase KMZ to GPX converter unpacks the KMZ archive in your web browser and writes the map inside it as a GPX file. What you get:

- **Pins become waypoints** and paths become tracks; a polygon is written as a closed track around its edge.
- **Carried over:** names, descriptions as plain text, altitude as elevation, and the time of every point of a Google Earth recorded track.
- **Not carried over:** icons and photos packed in the KMZ, ExtendedData fields, folders and line colours. GPX has no place for them.
- **Private by design.** The KMZ is read on your device, up to 50 MB, with no upload and no sign-up.

## What it does
- Convert KMZ files to GPX without unzipping them first
- Placemarks become GPX waypoints, paths become GPX tracks
- Polygons become closed tracks around their outer edge
- Keeps names, descriptions, altitude and recorded track times
- Notes every field and area that changed on the way
- Shows the route on a map before you download
- Runs in the browser: the KMZ is not uploaded

## How to convert KMZ to GPX
1. Export the KMZ. In Google My Maps, open the three-dot menu next to the map title, choose Export to KML/KMZ and pick the layer with your route; leaving the KML box unticked gives a .kmz. In Google Earth Pro, right-click the path under Places → Save Place As.
2. Drop the .kmz on the box above, or press Choose a file. The sample is a small Barcelona KMZ with five places, a walking route and three areas.
3. Check the map: your route is a line, your places are pins. The notes underneath say which areas became closed tracks and which fields were left out.
4. Press Download GPX. Import it as a course in Garmin Connect, or open it in Komoot, OsmAnd, Gaia GPS, Wikiloc or another app that reads GPX.

## Formats and limits
- **Opens:** .kmz or .kml, up to 50 MB. Other map files (KML, KMZ, GPX, GeoJSON, shapefile, CSV) convert too.
- **Downloads:** GPX, 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-gpx/?sample=1
- Download the sample file (the one Open a sample opens): https://spatibase.com/tools/samples/barcelona.kmz

## What your KMZ becomes in the GPX
| What | What happens |
|---|---|
| The KML inside the KMZ | Read for you: `doc.kml` at the top of the archive, or the first .kml if there is no doc.kml. |
| Placemarks | Waypoints (`wpt`) with name, description and, if the placemark has a `TimeStamp`, its time. |
| Paths and lines | Tracks (`trk`), one track segment for each part of a line. |
| Recorded Google Earth tracks (`gx:Track`) | Tracks that keep a time on every point. |
| Polygons | A closed track around the outer boundary; inner holes are dropped, since GPX knows no areas. |
| Altitude | The `ele` value of each point. |
| Photos and icons packed in the KMZ | Not included: a GPX file is text only, and GPS apps show their own symbols. |
| ExtendedData, folders and styles | Dropped. The notes name each field that had no place in the GPX. |

## Why a GPS needs GPX, not KMZ
**KMZ is made for Google Earth.** It is a zip archive holding a KML map (placemarks, paths, areas, styles) and often the pictures the map uses. Google My Maps hands you one by default when you export.

**GPX is made for navigation.** Garmin, Wahoo, Suunto, Coros and almost every outdoor app import GPX, while few of them open a KMZ. So a route planned in My Maps needs one conversion before it reaches your wrist or handlebar.

Two ways a GPX stores a line, and why this converter picks tracks:

- **A track (`<trk>`)** keeps every point of your path, so the device shows exactly the line you drew. This is what you get here.
- **A route (`<rte>`)** is a few turn points; the device works out the way between them and may take another street.

**Already have a plain .kml?** The KML to GPX converter takes it the same way, and it also accepts KMZ.

## KMZ to GPX in a terminal: unzip, then GPSBabel
GPSBabel reads the KML but not the zip around it, so take `doc.kml` out of the archive first:

```bash
# see what the KMZ holds, then pipe the main KML out
unzip -l trip.kmz
unzip -p trip.kmz doc.kml > trip.kml

# KML in, GPX out
gpsbabel -i kml -f trip.kml -o gpx -F trip.gpx
```

**In JavaScript,** `unzipSync` from `fflate` opens the KMZ and `kml()` from `@tmcw/togeojson` reads the KML inside into GeoJSON, which is how this converter starts; it then writes the GPX itself.

## Frequently asked questions
### How do I put a Google My Maps KMZ on my Garmin?
Convert the KMZ here and download the GPX. In Garmin Connect, go to Courses, choose Import, pick the GPX and save it as a course, then send it to your watch or Edge bike computer.

### Can Komoot import a KMZ file?
No. Komoot imports GPX and FIT files, not KMZ or KML. Convert the KMZ to GPX first, then import it from the route planner and save it as a planned tour.

### Do I need to unzip the KMZ before converting it to GPX?
No. Drop the .kmz as it is and the converter reads the KML inside the archive. Only command-line tools such as GPSBabel need the doc.kml taken out first.

### What happens to the areas I drew in My Maps?
Each area becomes a closed track that follows its outer edge, because GPX has points and lines only. Holes inside an area are left out. The notes count the areas that were changed.

### Are the custom icons and photos from the KMZ kept?
No. GPX stores coordinates and a few text fields per point, not images. Your GPS app or device draws its own symbols for waypoints and tracks.

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