GPX vs KML

Use GPX to move a track or a route between GPS apps and devices. Use KML to show places, lines and areas in Google Earth or on a map, with your own colours and icons.

Open either format in the GPX viewer or the KML viewer. It runs in your browser, and the file never leaves your device.

What GPX and KML files can store

DataGPXKML
Recorded tracksYesYes
More than one trackYesYes
Track segmentsYesYesAs a MultiGeometry
Planned routesYesYesWritten as lines, read back as tracks
WaypointsYesYesAs Point placemarks
File name and titleYesYes
DescriptionYesYes
AuthorYesNo
Creation timeYesNo
LinksYesNo
Track namesYesYes
Activity typeYesNo
ElevationYesYes
TimestampsYesYesOnly in gx:Track
Heart rateWith an extensionGarmin TrackPointExtensionWith an extensionExtendedData in gx:Track
CadenceWith an extensionGarmin TrackPointExtensionWith an extensionExtendedData in gx:Track
PowerWith an extensionGarmin PowerExtension, not read by every appWith an extensionExtendedData in gx:Track
TemperatureWith an extensionGarmin TrackPointExtensionWith an extensionExtendedData in gx:Track
SpeedWith an extensionGarmin TrackPointExtension v2With an extensionExtendedData in gx:Track

This table comes from the code of TrackLoupe, and the notes say how each field is stored. The converters use the same table to tell you what a conversion keeps and what it loses.

The main differences

Difference GPX KML
Made for Exchanging GPS data between apps and devices Showing geographic data in Google Earth and maps
Coordinates Latitude and longitude as attributes Longitude, latitude and altitude in one text
Times On every point of a track Only in a gx:Track
Styles None Colours, line widths and icons
Areas None Polygons
Google Earth Not imported by the web version Imported directly
Zipped version None KMZ

Both are XML text, and both store elevation in metres.

When to use GPX

When to use KML

Converting between GPX and KML

The table above shows what survives in each direction. A few points need care:

Questions

Can Google Earth open a GPX file?

Google Earth on the web imports KML, KMZ, GeoJSON and shapefiles. For GPX files, Google’s documentation says to convert them to KML or CSV first.

Which one does Google My Maps accept?

Both. My Maps imports GPX files up to 40 MB and KML files up to 5 MB.

Do both formats store elevation?

Yes. GPX stores it in the <ele> element of each point, and KML as the third value of each coordinate.

Where can I open both?

The GPX viewer and the KML viewer open GPX, KML and KMZ files in your browser, without uploading them.