GPX to KML converter

Turn a GPX track from your GPS watch, bike computer or hiking app into a KML file for Google Earth. See the route on a map first. Free, and no account needed.

Drop a GPX file here

Download the sample

Your file stays on your computer: nothing is uploaded.

In short

Convert GPX to KML online, in your browser

The Spatibase GPX to KML converter turns a GPX file from Garmin Connect, Strava, Komoot or any GPS device into KML, in your web browser. What carries over:

  • Lines and placemarks. Each track becomes a line (one part per track segment), each route a line, and each waypoint a placemark with its name, description, symbol and elevation.
  • Not carried over: the time of every track point, and sensor data such as heart rate, cadence and power.
  • Never uploaded. Your track stays on your computer. GPX files up to 50 MB convert without an account.
How to

How to convert GPX to KML

  1. Export the GPX. On strava.com, open the activity, press the three dots and choose Export GPX. In Garmin Connect, open the activity, press the gear icon and choose Export to GPX. Komoot, OsmAnd and most GPS units save GPX too.
  2. Drop the .gpx file on the box above, or press Choose a file. No file at hand? Try the sample: five Barcelona waypoints, a walking route, and three areas saved as closed tracks.
  3. Check the map. Tracks and routes are lines and waypoints are pins: click one to see its name and description.
  4. Press Download KML. Open it in Google Earth Pro with File → Open, import it into a project in Google Earth on the web, or add it as a layer in Google My Maps.
What’s kept

What the KML keeps from your GPX

WhatWhat happens
Tracks (trk)A line per track. Each track segment (trkseg) stays its own part, so a pause in recording doesn’t draw a straight jump across the map.
Routes (rte)A line through the route points, in order.
Waypoints (wpt)A placemark each, with name and description.
Elevation (ele)Kept as the third value of every coordinate. Google Earth still draws the line on the ground unless you change its altitude setting.
Symbol, type and comment (sym, type, cmt)Kept as data fields on the placemark.
Start time of a track, time of a waypointKept as a time field on the placemark.
Time of each track pointNot kept. A KML line has no timestamps, so the track won’t play on Google Earth’s time slider.
Heart rate, cadence, powerDropped. Garmin and Strava store them per point in GPX extensions, and a KML line has no place for them.
Formats

GPX or KML: which one does your app need?

The two formats were made for different jobs:

  • GPX is a GPS log. It records where you were and when: track points with latitude, longitude, elevation and a <time>, often with heart rate or cadence from a sensor. Watches, bike computers and fitness apps read and write it.
  • KML is for showing places. Google Earth and Google My Maps use it to draw placemarks, lines and areas with names, descriptions and styles. A KML line is a list of coordinates, nothing more.

Whether you need to convert at all depends on where the file goes:

  • Google Earth on the web: imports KML and KMZ, not GPX. Convert first.
  • Google Earth Pro: opens a GPX itself (File → Open, file type GPS). Convert when you want a KML to share or edit.
  • Google My Maps: imports GPX as well. KML helps when you want the track as a layer next to other KML data.
  • GIS apps and websites: many take KML or GeoJSON but not GPX, and this page gives you both.

Keep the GPX. It stays the complete record with times and sensor data. The KML is a copy for viewing and sharing, and it can’t be turned back into the full activity.

Do it in code

Convert GPX to KML on the command line

GPSBabel, the free GPS file converter, does it in one line, and with one option it also keeps the timestamps:

# lines and waypoints only (points=0: no placemark per track point)
gpsbabel -i gpx -f ride.gpx -o kml,points=0 -F ride.kml

# keep each point's time as a gx:Track, for Google Earth's time slider
gpsbabel -i gpx -f ride.gpx -o kml,points=0,track=1 -F ride.kml

In JavaScript, @tmcw/togeojson reads GPX into GeoJSON (this converter uses it too), and the tokml package writes GeoJSON out as KML.

FAQ

Questions about converting GPX to KML

Can Google Earth open a GPX file without converting it?

Google Earth Pro on the desktop can: choose File → Open, set the file type to GPS and pick the .gpx. Google Earth in the browser imports KML and KMZ but not GPX, so convert the file first.

Does the KML keep the timestamps of my track?

Only the start time, as a field. Each track becomes a KML line with elevation but without a time on every point, so it won’t replay on Google Earth’s time slider. To keep them, open the GPX in Google Earth Pro and choose KML Tracks in its import dialog, or use GPSBabel with the track=1 option.

What happens to heart rate, cadence and power data?

They are left out. Garmin and Strava store them for each track point in GPX extensions, and KML has nowhere to put them. Keep the original GPX if you need that data.

Do I need to convert GPX to KML for Google My Maps?

Usually not: My Maps imports GPX directly (Add layer → Import). Convert when the app you use next only reads KML, or when you want the same track in Google Earth on the web.

Is my GPS track uploaded anywhere?

No. The conversion runs in your browser, so the file, and the places it shows you were, stay on your computer. Only the map background is loaded from the internet.

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.