User Rating 0.0
Total Usage 0 times
Drop .gpx file here or click to browse Max 50 MB • GPX 1.0 / 1.1
or paste GPX content
JSON Output
Awaiting GPX input...
Is this tool helpful?

Your feedback helps us improve.

About

GPX (GPS Exchange Format) is an XML schema for describing waypoints, tracks, and routes. Raw GPX is verbose and difficult to process programmatically. Incorrect parsing drops trackpoints, truncates elevation data, or silently ignores route segments. This converter uses the browser's native DOMParser to walk the full GPX document tree, extracting trkpt coordinates (latitude φ, longitude λ), elevation ele, timestamps, waypoints wpt, routes rte, and nested metadata into a clean JSON structure. It also computes track statistics: total distance via the Haversine formula, cumulative elevation gain and loss, and duration.

The tool handles multi-track and multi-segment GPX files conforming to GPX 1.0 and 1.1 schemas. Extension elements are preserved as generic key-value objects. Note: coordinate precision is limited to the source file's decimal places. Garmin, Strava, and Komoot exports are all valid inputs. Files exceeding 50 MB are rejected to prevent browser memory exhaustion.

gpx to json gpx converter gps data converter gpx parser geojson track converter waypoint export

Formulas

Distance between consecutive trackpoints is computed using the Haversine formula, which accounts for Earth's spherical geometry:

a = sin2(Δφ2) + cos(φ1) cos(φ2) sin2(Δλ2)
d = 2 R atan2(a, 1 a)

Where φ is latitude in radians, λ is longitude in radians, Δφ = φ2 φ1, Δλ = λ2 λ1, and R = 6371 km (mean Earth radius, WGS-84).

Elevation gain is the sum of all positive elevation differences between consecutive points: gain = ni=1 max(0, elei elei1). Elevation loss uses the same logic for negative differences. Average speed v = dtotaltelapsed, computed only when timestamps exist.

Reference Data

GPX ElementXPathJSON Output KeyData TypeDescription
Metadata Name/gpx/metadata/namemetadata.nameStringDocument title
Metadata Description/gpx/metadata/descmetadata.descriptionStringDocument description
Metadata Author/gpx/metadata/author/namemetadata.author.nameStringCreator name
Metadata Time/gpx/metadata/timemetadata.timeISO 8601Creation timestamp
Track/gpx/trktracks[]ArrayOrdered collection of segments
Track Segment/gpx/trk/trksegtracks[].segments[]ArrayContinuous sequence of points
Track Point/gpx/trk/trkseg/trkpttracks[].segments[].points[]ObjectSingle GPS fix with lat, lon
Elevationtrkpt/elepoint.elevationFloat (m)Altitude above sea level
Timestamptrkpt/timepoint.timeISO 8601UTC time of fix
Waypoint/gpx/wptwaypoints[]ObjectNamed POI with coordinates
Waypoint Namewpt/namewaypoint.nameStringWaypoint label
Waypoint Symbolwpt/symwaypoint.symbolStringIcon identifier
Route/gpx/rteroutes[]ArrayOrdered list of route points
Route Point/gpx/rte/rteptroutes[].points[]ObjectPlanned navigation point
Extensions*/extensions/**.extensionsObjectVendor-specific data (HR, cadence, power)
Heart Rate (Garmin)extensions/hrpoint.extensions.hrInteger (bpm)Heart rate from chest strap or watch
Cadenceextensions/cadpoint.extensions.cadInteger (rpm)Pedaling or step cadence
Powerextensions/powerpoint.extensions.powerInteger (W)Cycling power meter output
Bounds/gpx/metadata/boundsmetadata.boundsObjectBounding box: minlat, maxlat, minlon, maxlon
Link/gpx/metadata/linkmetadata.linkObjectURL with text and type attributes

Frequently Asked Questions

Each element becomes a separate object in the tracks[] array. Within each track, every becomes a nested segments[] array. This preserves the hierarchical structure. A GPX file from a multi-day hike with 3 tracks and 5 segments total produces exactly 3 track objects with their respective segment arrays intact.
Yes. Any child elements under at any level (trackpoint, track, or root) are recursively parsed into a generic extensions object. For example, Garmin's TrackPointExtension containing heart rate (hr) and cadence (cad) values appear as key-value pairs. The local element name is used as the key, stripping namespace prefixes for readability.
The converter gracefully omits missing fields. If a lacks an child, the elevation property is set to null in the JSON output. If no
The Haversine formula assumes a perfect sphere with radius 6371 km. For most GPS tracks, this introduces error below 0.3% compared to the Vincenty formula (ellipsoidal model). At track scales under 1000 km, the difference is negligible. The primary source of distance error is GPS fix noise in the source data, not the formula.
Yes. Power data typically resides in vendor-specific extension elements. The recursive extension parser captures all such fields. A Wahoo ELEMNT export with power (W), temperature (°C), and speed values will appear under each trackpoint's extensions object. You can then process the JSON programmatically to compute normalized power or training stress.
The limit is 50 MB. The browser's DOMParser loads the entire XML document into memory, and JavaScript object creation roughly doubles the footprint. A 50 MB GPX file can consume over 150 MB of heap memory. Typical GPX files from day-long activities are 1-5 MB. Ultra-endurance files with 1-second recording intervals rarely exceed 20 MB.