b2KIT

GPX to GeoJSON Converter

Convert GPX track files to GeoJSON format with elevation and timestamp data preserved.

Tested tool guide Tested browser tools Checked August 16, 2026

What GPX to GeoJSON Converter does and how it behaves

A GPX track stores a journey as ordered XML track points, while GeoJSON expresses geographic data as JSON geometries and properties. This converter reads the track points, forms GeoJSON line geometry from their coordinates, and retains available elevation and timestamp values with the converted data. The most common surprise is coordinate order: GPX labels points with latitude and longitude attributes, but GeoJSON positions place longitude before latitude. Processing stays in the browser, so potentially sensitive location histories are not uploaded.

How the result is produced

1

Translating track points

Within GPX, each trkseg contains an ordered sequence of trkpt elements. Their lat and lon attributes supply horizontal positions, while optional ele and time child elements supply elevation and recording time. The converter follows that point order when constructing the track geometry. It can preserve values that exist in the source, but it cannot infer missing elevations, timestamps, or points.

2

Building the GeoJSON result

GeoJSON position arrays put longitude first and latitude second; an optional third number represents height. Core GeoJSON does not define a timestamp member or a standard time dimension for positions, so retained GPX times are associated metadata that consuming software must understand. For files containing several tracks or segments, inspect the resulting geometry type and feature boundaries before treating the output as one continuous line.

Good uses

  • Convert a recorded hike, ride, or run before loading it into mapping software that accepts GeoJSON but not GPX.
  • Prepare GPS track geometry for a web map while retaining the source elevations and sample times needed for a profile or playback.
  • Compare a field-recorded track with roads, boundaries, or observations already stored as GeoJSON features.

Limits and checks

  • Read every GeoJSON position as longitude, latitude. Reversing the two values can place an otherwise valid track in the wrong country or outside the visible map.
  • Do not assume several GPX track segments form one uninterrupted path. Segment breaks can represent recording pauses or disconnected portions, so verify the output's feature and geometry structure.
  • Preserving elevation and time does not create them when they are absent. Also verify any names, descriptions, heart-rate readings, cadence data, or other vendor extension fields separately; they are outside the converter's stated preservation guarantee.

Common questions

Will every output point have elevation and a timestamp?

No. The converter preserves elevation and timestamp data supplied by the GPX track, but those elements are optional at individual points. If the recorder omitted a value, the conversion cannot reconstruct it. Check the generated data before calculating ascent, speed, elapsed time, or sampling intervals, because those calculations depend on sufficiently complete source measurements.

Does conversion combine multiple GPX track segments into one route?

Do not assume that it does. GPX deliberately distinguishes tracks and track segments, and GeoJSON can represent those divisions through separate features, separate line parts, or other valid structures. Inspect the returned feature count and geometry types. A visible line may also conceal a segment boundary unless the receiving map styles each part distinctly.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools