GPX vs KML — What's the Difference?

GPX was made for GPS devices and sports trackers, KML for Google Earth visualization. GPX records routes, KML styles them.

Criteria GPX KML
GPS devices✓✗
Google Earth✗✓
Styles & colors✗✓
Time & speed✓✗
Sports apps✓✗

When to use GPX

For Garmin, Strava, Komoot, sports tracks, navigation.

When to use KML

For Google Earth, beautiful presentations, styled maps.

What is GPX?

Example OpenStreetMap map exported to GPX
GPX: an OpenStreetMap map exported by osm2cdr.

GPX (GPS Exchange Format) was released by TopoGrafix in 2002, and the current version, GPX 1.1, dates from 2004. It is an open, lightweight XML schema for moving location data between GPS devices and software.

A GPX file holds three kinds of data: waypoints (single named points), routes (ordered lists of points to follow) and tracks (recorded paths made of segments of track points). Each point has latitude and longitude plus optional elevation, time, name and description; extensions add things such as heart rate.

Software that opens GPX

Garmin BaseCamp and Garmin devices, Wahoo and Hammerhead bike computers, Strava, Komoot, OsmAnd, Locus Map, GPXSee and QGIS read GPX.

Where GPX is strong

It is the common language of navigation devices and sports apps, so a file prepared on a computer reaches a watch or a handlebar unit without conversion. Time stamps make it the natural format for recorded activities.

Limitations of GPX

GPX has no polygons, no styling and only minimal attributes, so an area becomes just its outline. A track is geometry, not turn-by-turn guidance, and files with very many points slow down small devices.

What osm2cdr puts into a GPX file

osm2cdr turns points of interest into waypoints that show up as markers on the device screen, and linear features into lines you can walk or ride along. Areas arrive as outlines only, point elevations are not filled in, and turn prompts are left to the navigator's own routing data.

What is KML?

Example OpenStreetMap map exported to KML
KML: an OpenStreetMap map exported by osm2cdr.

KML (Keyhole Markup Language) was developed by Keyhole, the company behind Google Earth, which Google acquired in 2004. Google later handed it to the Open Geospatial Consortium, and KML 2.2 became an OGC standard in 2008.

A KML document is XML: placemarks with points, lines and polygons are organised in folders, each with a name, a description and optional ExtendedData attributes. Styles define icons, line widths and fill colours; altitude modes and extrusion let features rise above the ground; network links and ground overlays pull in external content.

Software that opens KML

Google Earth Pro and Google Earth on the web open KML with a double click or a drag; Google My Maps, QGIS, ArcGIS, Global Mapper, Marble and many mobile apps import it.

Where KML is strong

KML is built for presentation: a client can explore the data on a globe without GIS skills, click a feature to see its attributes and switch folders on and off. As text it is easy to generate, inspect and edit.

Limitations of KML

It supports only WGS 84, files grow quickly because XML is verbose, and styling is limited to what Google Earth understands. It is a poor fit for analysis: attribute schemas are loose, and large datasets slow the viewer down.

What osm2cdr puts into a KML file

osm2cdr places each layer in its own folder, keeps the OSM tags of every feature in ExtendedData and gives lines and fills a colour and width. Roads, water and greenery lie on the ground, while buildings are extruded to the height from their tags, so Google Earth shows a three-dimensional city straight away.

Key differences explained

At the most basic level, GPX is an XML format for GPS waypoints, routes and tracks, while KML is an XML format for showing geographic data on a virtual globe. On disk, GPX is plain XML text; KML is plain XML text.

Here is what the comparison table above means in practice, point by point:

Example OpenStreetMap map exported to TCX
A related export: the same kind of map in TCX, a format often used next to GPX.

In short: choose GPX when the features have to end up on a GPS navigator, a bike computer or a sports app. Choose KML when the result is shown on a globe to a client, colleagues or students.

GPX or KML: which one fits your job?

You are planning a cycling tour and want the region's paths and points of interest on a Garmin or Wahoo unit. GPX goes straight onto the device or into Komoot and Strava, while KML would need converting first.

You are presenting a planned route and nearby landmarks to a client on a 3D globe. KML in Google Earth shows coloured lines, folders and extruded buildings, none of which GPX can express.

You are logging field visits and want time stamps and elevation stored with every point. GPX records both natively and suits activity analysis, whereas KML is aimed at visual presentation.

Pitfalls when switching between GPX and KML

Converting KML to GPX drops styles, folders and polygons — areas survive as outlines at best, and extruded buildings become flat shapes. Converting GPX to KML keeps the geometry, but time data and device extensions may be lost depending on the tool. Remember also that osm2cdr's GPX does not fill in point elevations and provides lines to follow rather than turn-by-turn routes; the navigation prompts come from the device's own routing data.

If you need both, export the area twice: the GPX for the device in your pocket and the KML for the meeting room screen. Each export is built from the same OpenStreetMap data, so the paths shown to the client are the paths on the navigator.

Which to pick on osm2cdr

On osm2cdr, pick GPX for navigators, bike computers, watches and sports apps. Pick KML for Google Earth presentations, sharing on a globe and visual review with people who do not use GPS devices at all.

How to get GPX or KML from OpenStreetMap

osm2cdr builds GPX and KML directly from OpenStreetMap data — there is no need to download raw OSM extracts or install conversion tools. The steps:

  1. Open the osm2cdr map for GPX and find your place by name, or draw a rectangle around the area.
  2. Choose GPX or KML in the format list and set the options offered for it, such as map layers, style or sheet size.
  3. Start the export and download the result: GPX arrives as a .gpx file; KML arrives as a .kml file.
  4. Need KML as well as GPX? Run a second export of the same area. Both start from the same OpenStreetMap data, but each keeps only what its format can hold, as described in the sections on GPX and KML above.

Converter pages related to GPX and KML explain each route in more detail:

Frequently asked questions

What is the main difference between GPX and KML?

GPX is an XML format for GPS waypoints, routes and tracks, whereas KML is an XML format for showing geographic data on a virtual globe. In the comparison table, GPX is ahead on GPS devices, time & speed and sports apps; KML is ahead on google Earth and styles & colors.

Which is better for GPS devices, GPX or KML?

GPX. It is the common language of navigation devices and sports apps, so a file prepared on a computer reaches a watch or a handlebar unit without conversion.

When does KML beat GPX?

When google Earth and styles & colors matter most. KML is built for presentation: a client can explore the data on a globe without GIS skills, click a feature to see its attributes and switch folders on and off.

Can I convert GPX to KML?

Yes. osm2cdr has a dedicated GPX to KML converter page for existing files. If you are starting from OpenStreetMap, export the area straight to KML instead.

Which programs open GPX and KML files?

GPX files open in Garmin BaseCamp, Strava, Komoot, OsmAnd, GPXSee and QGIS. KML files open in Google Earth, Google My Maps, QGIS, ArcGIS and Global Mapper.

Do GPX and KML keep real-world coordinates?

GPX stores WGS 84 latitude and longitude, with optional elevation and time for every point. KML always uses WGS 84 longitude, latitude and optional altitude, so features land in the right place in Google Earth without any setup.

Export to GPX Export to KML