Live Online ConverterChannel: gpxgeojson

GPX to GeoJSON Converter

Convert a GPS track file (GPX) into a GeoJSON file.

Easily translate GPS exchange format XML structures into clean, lightweight GeoJSON features. Waypoints, track logs, and elevations convert seamlessly to coordinate arrays.

Drag file here to convert, or select file

Supported file extension: .gpx • Max 50MB

Channel: Direct Stream ModeGDAL Driver Operational

Specification Rules

  • Plot hiking, cycling, or run tracking coordinates onto customized leaf maps
  • Convert modern Garmin or Strava track metrics for custom fitness application dashboards
  • Expose raw coordinate arrays directly to JavaScript web applications
  • Detailed health telemetry layers (heart rate, cadence) could drop during output
  • High frequency track records generate large JSON payloads
  • Strict spatial parsing separates trackpoints from isolated waypoints

GDAL Direct Equivalent Terminal Command

sh — gdalready
$ogr2ogr -f GeoJSON output.geojson input.gpx tracks

When to use this conversion

Convert when a GPS track (Garmin, Strava export, Komoot, smartphone GPS app) needs to display on a web map or feed a JavaScript analytics pipeline. GeoJSON is the right pivot for any track data destined for browser visualisation.

Technical Details

GDAL parses GPX XML and exposes four layers: waypoints (Point geometries with name/description), routes (LineString), tracks (MultiLineString from track segments), and route_points / track_points (Point per coordinate with elevation and timestamp). The output is a single FeatureCollection unless you select one of the four layers explicitly. Coordinates are always WGS 84.
Output file size

GeoJSON is typically 50–80% the size of the source GPX. XML overhead and timestamps make GPX larger per coordinate; GeoJSON drops the verbose <trkpt> wrappers.

Common Errors & Fixes

  • Empty track segments: <trk> elements with no <trkpt> children produce empty features. Fix: filter with -where "geometry_type IS NOT NULL" or strip empties in source.
  • Heart-rate and cadence extension data lost: GPX <extensions> namespace not mapped to standard GeoJSON properties. Fix: use -oo GPX_USE_EXTENSIONS=YES to extract them as properties.
  • Wrong layer chosen: defaulting to waypoints when you wanted tracks. Fix: pass the layer name explicitly as the last argument to ogr2ogr.
  • Multi-segment tracks merged: each <trkseg> becomes a LineString in a MultiLineString, but some tools expect separate features. Fix: explode multi-geometries with -explodecollections.

Alternative Tools

  • togpx / @tmcw/togeojson for JavaScript GPX parsing
  • QGIS: load the GPX (it appears as four sub-layers), export the one you want as GeoJSON
  • ogr2ogr CLI: ogr2ogr -f GeoJSON output.geojson input.gpx tracks
  • gpsbabel for advanced GPX cleaning before conversion

Frequently Asked Questions

How are trackpoints and waypoints separated?

GPX files keep distinct layers for waypoints, tracks, and routes. Our proxy automatically parses the main track path as a LineString.

Are elevation and timestamp records kept?

Yes. Elevation and timestamps are mapped inside the coordinate properties of your GeoJSON features.

Is security guaranteed?

Yes — your file is processed on our isolated GDAL worker in a per-request temporary directory and deleted in full immediately after the conversion completes, even on error.

Related Transformations Map