What Is a .GPX File?

GPS Exchange Format

📂Data
🏷️.gpx
🎯application/gpx+xml

GPX GPS Exchange File (.gpx)

Overview

GPX (GPS Exchange Format) is an XML schema for GPS data: waypoints, routes and tracks, with coordinates, elevation and timestamps. It is the common language of GPS devices, fitness watches, mapping sites and hiking apps, and the format you get when you export a run from Strava, a hike from AllTrails or a track from a Garmin.

A .gpx file is plain text. It opens in a text editor as a list of latitude and longitude points, and in any mapping application as a line on a map.

Technical Specifications

  • MIME Type: application/gpx+xml
  • File Extension: .gpx
  • Category: Data
  • Format: XML, UTF-8
  • Current schema: GPX 1.1 (2004); GPX 1.0 (2002) is still common
  • Coordinate system: WGS 84 decimal degrees
  • Developer: TopoGrafix, released as an open format
  • Extensions: Garmin, Strava and others add heart rate, cadence, power and temperature through namespaced <extensions> elements

Identification

No binary signature; an XML file with a <gpx> root element:

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="Garmin Connect" xmlns="http://www.topografix.com/GPX/1/1">
  <metadata><time>2026-05-04T07:12:00Z</time></metadata>
  <trk>
    <name>Morning run</name>
    <trkseg>
      <trkpt lat="51.5007" lon="-0.1246"><ele>12.4</ele><time>2026-05-04T07:12:03Z</time></trkpt>
      <trkpt lat="51.5009" lon="-0.1251"><ele>12.6</ele><time>2026-05-04T07:12:08Z</time></trkpt>
    </trkseg>
  </trk>
</gpx>

File Structure

Three kinds of data, any of which may appear in one file:

  • Waypoints (<wpt>): single named points, such as a campsite or a photo location.
  • Routes (<rte>): an ordered list of points describing where to go, as planned ahead of time.
  • Tracks (<trk>): a recorded path of where a device actually went, split into segments (<trkseg>) whenever the signal dropped or recording paused. Each <trkpt> carries lat, lon, and optionally <ele> (metres) and <time> (ISO 8601 UTC).

Everything beyond that lives in <extensions>, where device vendors store sensor data. Garmin's TrackPointExtension for heart rate and cadence is the most widely understood.

History and Development

Dan Foster of TopoGrafix published GPX 1.0 in 2002 to replace the proprietary and incompatible formats of early consumer GPS units. GPX 1.1 followed in 2004 with a cleaner schema and the extensions mechanism. Because it is open and simple, it became the universal import and export format, even after Garmin introduced the richer FIT format for its own devices and the FIT and TCX formats spread through fitness platforms.

Common Use Cases

  • Exporting and importing activities between Strava, Garmin Connect, Komoot, AllTrails, Wikiloc, Ride with GPS and similar services
  • Loading a planned route onto a watch, bike computer or handheld GPS
  • Hiking and trail sharing: downloadable tracks from guidebooks and trail sites
  • Geotagging photos by matching camera timestamps against a GPS track
  • Mapping and surveying: collecting points for OpenStreetMap, field research, drone flight logs
  • Vehicle and fleet logs exported from trackers

How to Open a GPX File

View on a map (no install)

  • Google Earth (web and desktop): File, Import, or drag the file in. Draws tracks in 3D with elevation.
  • Google My Maps: Import a layer from the .gpx. The plain Google Maps app does not open GPX directly.
  • gpx.studio, GPS Visualizer, Strava's route builder: browser tools for viewing, editing and converting.
  • Komoot, Strava, AllTrails: import to your account, then view or follow on the phone app.

Desktop applications

  • Garmin BaseCamp (Windows, macOS): the traditional tool for Garmin owners.
  • QGIS: opens GPX as vector layers for analysis.
  • GPXSee, Viking, QMapShack: free viewers with maps and elevation profiles.
  • Any text editor: the coordinates are readable, if not visual.

Phones and devices

  • iPhone: open in Apple Maps (iOS 17 and later supports importing GPX for hiking), Komoot, Gaia GPS, AllTrails, or Garmin Connect.
  • Android: OsmAnd, Locus Map, Komoot, Gaia GPS. Google Maps on Android does not import GPX.
  • Garmin watches and Edge computers: copy to the Garmin/NewFiles folder over USB, or send through Garmin Connect as a course.
  • Wahoo, Coros, Suunto, Polar: import through their apps, usually as a route.

How to Convert a GPX File

GPSBabel (the universal converter)

Free, cross-platform, with a graphical interface and a command line:

# GPX to KML for Google Earth
gpsbabel -i gpx -f track.gpx -o kml -F track.kml

# GPX to CSV of points
gpsbabel -i gpx -f track.gpx -o csv -F track.csv

# Garmin FIT to GPX
gpsbabel -i garmin_fit -f activity.fit -o gpx -F activity.gpx

# Simplify a track to 500 points (for devices with limits)
gpsbabel -i gpx -f track.gpx -x simplify,count=500 -o gpx -F small.gpx

Other conversions

  • To FIT or TCX for fitness platforms: upload to Strava or Garmin Connect and export in the other format; gpx.studio also exports FIT.
  • To GeoJSON or Shapefile for GIS: QGIS, ogr2ogr -f GeoJSON track.geojson track.gpx tracks.
  • From a photo library: Lightroom and digiKam read GPX to geotag photos by time.

In code

import gpxpy                           # pip install gpxpy

with open("track.gpx") as f:
    gpx = gpxpy.parse(f)

for track in gpx.tracks:
    for seg in track.segments:
        print(f"{len(seg.points)} points, {seg.length_3d()/1000:.1f} km, gain {seg.get_uphill_downhill().uphill:.0f} m")

Common Problems

  • Watch rejects the file: too many points, or a track where a route was expected. Simplify, or convert the track to a route in BaseCamp or gpx.studio.
  • No elevation: many web exports omit <ele>. GPS Visualizer and gpx.studio can add elevation from terrain data.
  • Times shifted: GPX times are UTC; software displays them in local time. The file is correct.
  • Extensions ignored: heart rate and cadence survive only between apps that understand the same extension namespace.

Advantages

  • Universal: every GPS device and mapping service imports it.
  • Open, text-based and human-readable.
  • Simple to generate from any source of coordinates.
  • Extensible without breaking readers that ignore the extensions.

Limitations

  • Verbose: XML tags around every point make files large; FIT is a fraction of the size.
  • Sensor data is non-standard, living in vendor extensions.
  • No styling or map content, unlike KML.
  • Precision and time are optional, so files vary in quality.
  • XML: the underlying markup.
  • CSV: a common export for analysis.
  • JSON: the basis of GeoJSON, the web-mapping alternative.
  • ICS: another plain-text interchange format with the same import-everywhere role, for calendars.

How to identify .GPX files from the bytes

No binary signature. XML text with a <gpx root element. Identification relies on reading the structure, which is where a content-based detector earns its keep over a filename check.

File Information

File Description

GPS Exchange Format

Category

Data

Extensions

.gpx

MIME Type

application/gpx+xml

Related File Types

Other file types in the Data category you might also need:

Start Analyzing GPX Files Now

Use our free AI-powered tool to detect and analyze GPS Exchange Format files instantly with Google's Magika technology.

⚡Try File Detection Tool