GPX to GeoJSON Converter

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

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.

How the Conversion Works

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.

Common Use Cases

  • 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.

Try It

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.