GPX to GeoJSON Converter
Convert GPS-exchange .gpx tracks, routes, and waypoints into a GeoJSON FeatureCollection ready for web maps.
Paste a GPX track or upload a .gpx file from your watch or device and get back a GeoJSON FeatureCollection. Tracks become LineStrings, routes become LineStrings, waypoints become Points. Names, times, and elevation are kept on each Feature so downstream tools can chart pace and altitude.
GPX, the GPS Exchange Format, is the canonical container for tracks recorded by handheld GPS units, watches, and fitness apps. The 1.1 schema defines three top-level concepts: waypoints (single points of interest), routes (planned sequences), and tracks (recorded paths split into segments). Most modern tooling speaks GeoJSON instead, so converting GPX is a common first step before drawing a run on a web map or shipping a hike to a route planner.
The converter parses the XML in your browser, then togeojson maps GPX elements into GeoJSON: each <wpt> becomes a Point Feature, each <rte> becomes a LineString Feature joining its <rtept> coordinates, and each <trk> becomes one LineString per <trkseg>. The library preserves name, description, timestamps, and elevation on the resulting Feature properties, which lets downstream tools chart pace, climb, or moving time without re-reading the original.
The output follows RFC 7946: WGS 84 coordinates in longitude, latitude, with elevation as a third number where the source provided it.
- 1
Provide GPX
Upload the .gpx exported from your device or paste the XML into the input. GPX 1.0 and 1.1 are both accepted.
- 2
Convert
The DOMParser turns the text into a document, then togeojson walks waypoints, routes, and tracks into Features.
- 3
Use the output
Copy the JSON, download it as .geojson, or pipe it into a web map. Timestamps and elevation are kept on each Feature.
Show a ride on a web map
Turn a Strava or Garmin export into a LineString and drop it on a Mapbox layer for a personal training site.
Race or event mapping
Convert a planned route from a GPX route planner into GeoJSON for embedding in a registration page.
Spatial analysis
Load tracks into PostGIS or DuckDB Spatial through GeoJSON ingestion to query distance, elevation gain, or overlap with regions.
Backup and archival
GeoJSON is plain text and diff-friendly, making it a better long-term archive than the verbose GPX XML.
Does my GPX data get uploaded?
No. Parsing and conversion run in your browser. Your activity history never reaches a server.
Are timestamps and elevation kept?
Yes. Each track point keeps its time and elevation on the Feature properties, so pace and climb calculations are still possible downstream.
What happens to multi-segment tracks?
Each <trkseg> becomes its own LineString Feature. A pause that splits a track into segments will appear as separate lines.
Can I convert routes that have only waypoints?
Yes. Waypoints are emitted as Point Features and routes are emitted as LineStrings linking their route points. A GPX with only waypoints converts to a Point-only FeatureCollection.
Is the output GeoJSON valid?
It conforms to RFC 7946. Coordinates are WGS 84 in longitude, latitude order, with elevation as the optional third position element.