# GPX to KMZ converter

> Pack a GPX track, route or set of waypoints into a KMZ: one compressed file that Google Earth, Google My Maps and most map apps open. Free, and no account needed.

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

**GPS log in, Google Earth file out.** The Spatibase GPX to KMZ converter reads a GPX file in your web browser, writes it as KML and zips that KML as `doc.kml` inside a KMZ. The result:

- **Lines and pins.** Every track and route is a line (with elevation), every waypoint a placemark with its name, description, symbol and type.
- **A fraction of the size.** The GPX sample shrinks from 31 KB to about 5 KB, handy for email and chat attachments.
- **Left out:** the timestamp on each track point, plus heart rate, cadence and power, which a KML line can’t hold.
- **Your route stays private.** GPX files up to 50 MB are converted on your device and never uploaded.

## What it does
- Convert GPX to KMZ (zipped KML) for Google Earth and Google My Maps
- Tracks and routes become lines, waypoints become placemarks
- Keeps elevation, names, descriptions, symbols and types
- Keeps every track segment as its own part of the line
- A compressed file, several times smaller than the GPX
- Preview the track on a map before downloading
- Runs in the browser: the GPX is not uploaded

## How to convert GPX to KMZ
1. Save your activity or route as GPX: Strava, Garmin Connect, Komoot and Gaia GPS all have an Export GPX or Download GPX option, and most GPS devices write .gpx files directly.
2. Drop the .gpx file on the box above, or press Choose a file. To try first, open the sample: Barcelona waypoints, a walk and three areas as closed tracks.
3. Look over the map: lines are your tracks and routes, pins are your waypoints. The notes say what didn’t fit, such as per-point times.
4. Press Download KMZ. Double-click it to open in Google Earth Pro, import it into a Google Earth project on the web, or add it to a layer in Google My Maps.

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

## What goes from the GPX into the KMZ
| What | What happens |
|---|---|
| Tracks (`trk`) and routes (`rte`) | One line each. A track with several segments stays one placemark with several parts, so gaps in recording aren’t bridged. |
| Waypoints (`wpt`) | Placemarks with their name and description. |
| Elevation (`ele`) | The third number of each KML coordinate. |
| `sym`, `type` and `cmt` | Data fields on the placemark, shown in its balloon in Google Earth. |
| Time of a waypoint or a track’s start | A `time` data field. |
| Time of each track point | Dropped: the KMZ shows the path, not when you were where. The notes count the points that had a time. |
| Sensor data (heart rate, cadence, power) | Dropped, since KML has no field for values per point. |
| The file itself | A zip with a single `doc.kml` at its root, the layout Google Earth expects. |

## GPX, KML and KMZ: which file for which app
The three formats overlap, but each has its home:

- **GPX** is the GPS exchange format: watches, bike computers and fitness apps record and read it, with a time on every point.
- **KML** is Google Earth’s text format for placemarks, lines and areas with names and styles.
- **KMZ** is that same KML compressed into a zip, so it travels as one smaller file.

**When KMZ is the right pick.** Sending a track to someone who uses Google Earth, attaching it to an email, or uploading it where size counts. Google Earth on the web imports KML and KMZ but not GPX.

**When to keep the GPX.** For loading the route back onto a GPS, or for any analysis of pace and heart rate: the KMZ is a picture of the path, not the full activity. Keep the original next to it.

**Want plain text instead?** The GPX to KML converter gives the same placemarks as an unzipped .kml you can open in an editor.

## Make a KMZ from a GPX on the command line
With GDAL’s ogr2ogr (it comes with QGIS), GPX goes to KML in one command, and the zip tool makes it a KMZ:

```bash
# the tracks and the waypoints of ride.gpx, written as doc.kml
ogr2ogr -f KML doc.kml ride.gpx tracks waypoints

# a KMZ is a zip with doc.kml at its root
zip ride.kmz doc.kml
```

Good to know about the GDAL route:

- **Name the layers.** GDAL reads a GPX as five layers (`waypoints`, `routes`, `tracks`, `route_points`, `track_points`); without names it writes every track point as its own placemark too.
- **Keep `doc.kml` at the root.** Zip the file itself, not a folder holding it, or Google Earth may not find the KML.

## Frequently asked questions
### Can Google Earth open a GPX file directly?
Google Earth Pro on the desktop can, through File → Open with the GPS file type. Google Earth on the web cannot: it imports KML and KMZ. Convert the GPX to KMZ here and import that.

### Is a KMZ smaller than a GPX?
Usually by a lot. A KMZ is zipped, and a KML line stores each point as a short coordinate instead of a tag with a time, so a recorded track often shrinks to a fifth of its size or less.

### Will the KMZ keep the timestamps of my activity?
Only a start time per track, as a field. The time of each point is not written, so the track won’t replay on Google Earth’s time slider. Keep the GPX for the full record.

### How do I share a Strava or Garmin route with someone who uses Google Earth?
Export the activity or course as GPX, convert it here and send the KMZ. They can double-click it to open Google Earth Pro, or import it into a project in Google Earth on the web.

### Is my GPX file uploaded to convert it?
No. Your browser does the conversion on your device, so the track, and where you were, stays with you. Only the background map tiles come from the internet.

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