GPX vs KML — Which Format to Choose for GPS Tracks and Routes in 2026
GPX and KML are the two most popular XML formats for geographic data. Both readable in Notepad, both based on WGS84 coordinates, both free and open. The similarities end there. GPX was created by a single developer in a week back in 2002 to exchange GPS tracks between Garmin and Magellan navigators. KML was created by Keyhole Inc. (then Google) for 3D visualization in EarthViewer, then handed to OGC as an international standard. They have different philosophies, different audiences, different strengths. Let's break it down concretely: when is each format better.
History: Solo Developer vs Google
GPX (GPS Exchange Format) was born in March 2002. Dan Foster of TopoGrafix wrote an XML schema in a few weeks and published it on topografix.com under public domain license. The goal was utilitarian: exchange a GPS track between Garmin Etrex and Magellan Meridian without GPSBabel gymnastics. GPX 1.1 (August 2004) added extensions namespace and became canonical — the format hasn't changed since. Steward today — Dan Foster personally, no corporation, no royalties, no committees.
KML (Keyhole Markup Language) appeared in 2001 as the internal format of Keyhole EarthViewer — a commercial 3D globe that Google bought in 2004 and renamed Google Earth. Until 2007, Google published the KML 2.0, 2.1, 2.2 specifications at developers.google.com. In November 2007 Google handed the format to the Open Geospatial Consortium (OGC). On April 14, 2008, OGC ratified KML 2.2 as an international standard (document OGC 07-147r2). Steward — OGC KML SWG plus Google as the real implementer.
This origin difference explains everything. GPX is simple XML with three object types (point/route/track), no styling, no 3D, no animation. KML is a rich markup language with custom icons, 3D models, time animation, NetworkLink for live data, ground overlays for raster drapes.
What's Inside: File Structure
GPX uses <wpt>, <rte>, <trk> elements with lat/lon as XML attributes (latitude first). KML uses <Placemark> with <Point>, <LineString>, <Polygon>, <MultiGeometry> — coordinates inside <coordinates>lon,lat,alt</coordinates> (longitude first — opposite order from GPX). Structural difference: GPX is linear-data-only; KML is a universal geographic markup language.
<!-- GPX -->
<gpx version="1.1"><trk><trkseg>
<trkpt lat="35.6580" lon="139.7016"><ele>40</ele></trkpt>
</trkseg></trk></gpx>
<!-- KML -->
<kml><Document><Placemark>
<Point><coordinates>139.7016,35.6580,40</coordinates></Point>
</Placemark></Document></kml>
Capabilities — Detailed Table
| Feature | GPX | KML | KMZ (KML+ZIP) |
|---|---|---|---|
| Waypoints | Yes, <wpt> |
Yes, <Point> |
Yes |
| Linear routes | Yes, <rte> planned / <trk> recorded |
Yes, <LineString> |
Yes |
| Polygons (areas) | No | Yes, <Polygon> with holes |
Yes |
| Multi-geometry | No | Yes, <MultiGeometry> |
Yes |
| Custom icons | No (only Garmin sym list) |
Yes, <IconStyle> URL/embed |
Yes, packed in archive |
| HTML descriptions | Plain text in <desc> only |
Yes, <description> CDATA HTML |
Yes |
| 3D building models | No | Yes, <Model> COLLADA |
Yes, packed |
| Time animation | Via <trkpt> timestamps |
<TimeSpan>, <TimeStamp> slider |
Yes |
| Live network data | No | Yes, <NetworkLink> URL polling |
No |
| Raster overlays | No | Yes, <GroundOverlay> |
Yes, packed |
| Layer hierarchy | No (flat) | Yes, <Folder> recursive |
Yes |
| Heart rate / cadence / power | Yes, via gpxtpx: extensions |
No native | No |
| GPS accuracy (HDOP) | Yes, <hdop>, <sat> |
No | No |
| Built-in ZIP compression | No (external gzip) | No | Built-in |
| Web map JS-native | Only via omnivore.js | Only via omnivore.js | Via unzip |
File Size and Performance
For the same 50 km route with 1000 points:
- GPX 1.1 without extensions: ~250 KB
- GPX 1.1 with extensions (HR, cadence): ~400 KB
- KML 2.2 baseline: ~600 KB
- KMZ (KML+ZIP-compressed): ~80 KB
For a database of 5,000 POIs (name + coordinates + description):
- GPX 1.1: ~1.2 MB
- KML 2.2 with custom icons: ~3.5 MB
- KMZ with packed icons: ~250 KB
Parsing 10,000 points:
- GPX in Garmin BaseCamp: 0.5 sec
- KML in Google Earth Pro: 1.2 sec
- KML in QGIS: 0.8 sec
- KMZ in Google Earth Pro: 1.5 sec (including ZIP unpack)
Conclusion: for tracking, GPX is more compact. For presentations with custom icons, KMZ wins via ZIP compression. Bare KML without compression is the largest format — don't use it without reason.
Use Cases by Role
Hiker in the mountains. Route is planned in Komoot or OsmAnd, downloaded as GPX, loaded into a Garmin Etrex or GPSMAP. This workflow has worked since 2002, all Garmin hiking navigators understand only GPX. KML on a Garmin Etrex doesn't work at all — needs conversion via BaseCamp.
Cyclist training. Ride recording on a Garmin Edge or Wahoo Elemnt is saved as GPX or FIT (Garmin proprietary), syncs to Strava and Garmin Connect with one button. KML isn't needed at all — Strava doesn't even accept it in "Upload activity."
Investigative journalist. Chain of events: "shipment route," "crime scenes," "suspect movements" — that's KML with a chain of <Placemark> and HTML-formatted explanations. Open in Google Earth Pro gives the reader a visual story map. GPX doesn't fit — no descriptions, no district polygons, no styling.
Real estate developer. Presentation of a new residential complex to a client: 3D building models, infrastructure icons (metro, schools, parks), branded colors — that's KMZ in Google Earth Pro. GPX wouldn't allow any of this: just three points on a gray basemap.
Tour guide. A Prague route with 25 POI points, photo of each location, description — KMZ is more convenient. Tourists open on phones in Google Earth or Maps.me, see icons of cafe/museum/viewpoint, read brief descriptions. GPX would give only coordinates without styling.
Geocacher. geocaching.com database — GPX, because that's what the site exports. All geocaching apps (c:geo, Cachly, Garmin Chirp) are designed for GPX.
Sports coach. Athlete training analysis in GoldenCheetah or TrainingPeaks — GPX with the extensions namespace for heart rate and power. These systems import GPX directly, don't understand KML.
Field surveyor and OSM mapper. Track recording during a field walk — GPX. JOSM as background for drawing buildings and roads — GPX. KML is overkill here.
Software Compatibility
| Program | GPX read | GPX write | KML read | KML write | Advice |
|---|---|---|---|---|---|
| Garmin BaseCamp | Native | Native | Import | Export | GPX |
| Garmin Connect | Native | Via FIT | No | No | GPX |
| Garmin Edge / Etrex | Native | Record | No | No | GPX only |
| Strava | Native | Export | No | No | GPX |
| Komoot | Native | Native | Import | No | GPX |
| Wahoo Elemnt | Native | Record | No | No | GPX |
| Suunto / Polar | Native | Record | No | No | GPX |
| Google Earth Pro | Import | Export | Native | Native | KML |
| Google My Maps | Import | Import | Native | Export | KML |
| QGIS | Full | Full | Full | Full (no styles) | Either |
| ArcGIS Pro | Import | Export | Import | Export | Either |
| Maps.me | Import | No | Import | No | Either |
| OsmAnd | Native | Record | Import | No | GPX |
| Locus Map | Native | Record | Import | No | GPX |
When to Choose GPX
- Recording or planning a GPS track for a navigator. Garmin Etrex, Edge, Forerunner, Wahoo, Suunto — all understand GPX only.
- Sports training. Strava, Garmin Connect, Komoot, TrainingPeaks — GPX-native, won't accept KML.
- Simple points of interest. Database of up to 1000 POIs without custom icons — GPX is more compact and simpler.
- Sensor data. Heart rate, cadence, power, GPS accuracy — that's GPX 1.1 extensions namespace.
- OSM mapping. GPS tracks from field walks as background in JOSM — GPX.
When to Choose KML
- Google Earth presentation. 3D building visualization, city tours, educational overlays — KMZ.
- Custom icons and descriptions. Points with photos, HTML descriptions, links — need
<Style>and<BalloonStyle>. - Polygon data. District boundaries, park contours, construction zones — KML; GPX doesn't work here at all.
- Live data from the internet.
<NetworkLink>polls a URL every N seconds — unique among simple formats. - Time animation. Changes over a period with a timeline slider —
<TimeSpan>. - Raster overlays. Historical atlases or schematics over the modern planet —
<GroundOverlay>. - Google My Maps and embedding. Collaborative map work via My Maps — KML.
OSM Maps in GPX and KML via osm2cdr.ru
Both formats are available free on osm2cdr.ru. Same workflow.
Step 1. Open osm2cdr.ru, choose GPX or KML in Format Wizard.
Step 2. Outline the area. For a track — 5–30 km. For a Google Earth presentation — 1–10 km.
Step 3. Select layers. For GPX — Roads + POI is enough. For KML — add Buildings and Green; they look good on the Google Earth 3D basemap.
Step 4. Export. For GPX → load to Garmin/Strava/OsmAnd. For KML → double-click opens Google Earth Pro.
FAQ
The main difference between GPX and KML in one sentence? GPX — for GPS tracks and navigators (Garmin, Strava). KML — for Google Earth presentations with 3D and custom styling.
Which format is smaller? Raw, GPX is about 2–3x more compact than KML. But KMZ (ZIP-compressed KML) beats GPX thanks to ZIP compression.
Can I convert GPX to KML? Yes, lossless. Google Earth Pro: File → Import → choose GPX → auto-converts to KML layer. GPSBabel: gpsbabel -i gpx -f input.gpx -o kml -F output.kml. Reverse KML → GPX is possible but loses all styling and polygons.
Do Garmin Edge devices support KML? No. Only GPX and Garmin's own FIT format. Convert KML → GPX via Google Earth Pro or online converters.
Does Strava accept KML? No. Only GPX, FIT, and TCX. KML must be converted.
What to choose for a tour with a travel agency? If the client will view in Google Earth — KMZ. If the client will hike with a navigator — GPX. If both — give both files.
Can I combine tracks and polygons in one file? In KML — yes, <Placemark> of any geometry in one <Document>. In GPX — no, the format doesn't support polygons at all.
Is heart rate supported in KML? Not natively. Can be added via <ExtendedData> or <gx:Track> (Google extensions), but few read it. For sensor data — GPX only.
Which format for OSM mapping? GPX. It's the format for recording field tracks and background data in JOSM.
Related Materials
- GPX — complete GPS tracks format guide
- KML — complete Google Earth format guide
- GPX and GPS tracks: detailed guide
- KML and Google Earth: guide
- Garmin and OsmAnd: OSM-based navigation
- GPX format landing
- KML format landing
Sources
- TopoGrafix, GPX 1.1 Schema — topografix.com/gpx.asp
- OGC KML 2.2 Standard, April 14, 2008 — portal.ogc.org/files/?artifact_id=27810
- Google Developers, KML Reference — developers.google.com/kml/documentation/kmlreference
- Garmin Developer, TrackPointExtension — developer.garmin.com
- Wikipedia, GPS Exchange Format — en.wikipedia.org/wiki/GPS_Exchange_Format
- Wikipedia, Keyhole Markup Language — en.wikipedia.org/wiki/Keyhole_Markup_Language
- GPSBabel, format converter — gpsbabel.org