Skip to content

GPX to GeoJSON Converter

Convert GPX track files to GeoJSON format. Transform GPS data for web mapping.

Skip to the tool

GPX is the format handheld GPS units, Strava, Garmin and Komoot export. It is XML built around three ideas: waypoints, routes and tracks.

Tracks become LineStrings, routes become LineStrings, waypoints become Points. Timestamps and elevation ride along in the coordinates and properties where the source file provides them. Heart rate and cadence extensions are outside the GPX schema proper and do not survive the conversion.

Recreational GPS traces are noisy, so a track logged at one point per second is usually worth running through the simplifier before you put it on a web map.

What Is GPX?

GPX (GPS Exchange Format) is an XML-based format for storing GPS data, tracks, routes, and waypoints. It is the standard export format for GPS devices (Garmin, Suunto, etc.), fitness apps (Strava, Komoot), and outdoor navigation software.

What Maps Onto What

Paste your GPX XML content and the tool converts it to GeoJSON. The mapping is:

  • Waypoints (<wpt>) → GeoJSON Point features
  • Tracks (<trk>) → GeoJSON LineString features (one per track segment)
  • Routes (<rte>) → GeoJSON LineString features
GPX<wpt lat="40.7484" lon="-73.9857">
  <name>Empire State Building</name>
  <ele>443</ele>
</wpt>

Metadata like name, description, elevation, and timestamps are preserved as Feature properties where available.

What People Do With Converted Tracks

  • Visualizing GPS tracks from hiking, cycling, or running activities on a web map
  • Converting Strava or Garmin exports into GeoJSON for custom analysis
  • Importing GPS waypoints into web-based mapping applications
  • Combining GPS data with other GeoJSON layers using the merge tool

After conversion, you can measure the track length, simplify the route for smaller file sizes, or view it on a map.

A Recorded Track, Converted

Paste this GPX waypoint for the Statue of Liberty. The converter produces a GeoJSON Point feature with the name and elevation preserved as properties:

GPX<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="test">
  <wpt lat="40.6892" lon="-74.0445">
    <name>Statue of Liberty</name>
    <ele>93</ele>
    <desc>Liberty Island, New York Harbor</desc>
  </wpt>
</gpx>

The resulting GeoJSON output:

GeoJSON{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Statue of Liberty",
        "ele": 93,
        "desc": "Liberty Island, New York Harbor"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [-74.0445, 40.6892]
      }
    }
  ]
}

Notice that GPX stores coordinates as XML attributes (lat and lon), while GeoJSON uses a [longitude, latitude] array. The converter handles this reordering automatically.

How the GPX Parser Works

The converter parses the GPX XML document and iterates over three element types: <wpt> (waypoints), <trk> (tracks), and <rte> (routes). Waypoints become Point features. Track segments (<trkseg>) become LineString features by collecting all <trkpt> elements in order. Routes similarly become LineStrings from their <rtept> elements.

GPX files from fitness devices often contain thousands of trackpoints recorded at one-second intervals. After converting to GeoJSON, you can use the simplifier to reduce the vertex count, or consult the Web Mapping Guide for tips on displaying GPS tracks on interactive maps.