All converters
HomeGPX converter › GPX to GeoJSON

Convert GPX to GeoJSON

By , GIS & remote-sensing practitioner · Reviewed

Convert GPX to GeoJSON to move GPS recordings into Leaflet, Mapbox, D3 or any modern web stack. The parsing is done by your own browser, no upload involved, which also makes it quick for big track logs.

Drop a file here, or click to browse

KML, KMZ, SHP (.zip), GeoJSON, GPKG, GML, GPX, DXF, CSV, Excel, and more

No uploadNo trackingOpen standards (GDAL/OGR)Works offline once loaded

No GPX file to hand? Download a sample GPX file (100 points) and drop it above to see the conversion.

How to convert GPX to GeoJSON

  1. Drop your GPX recording into the box.
  2. The file's waypoints, tracks and routes appear on the preview map as they are parsed.
  3. Pick GeoJSON and convert; timestamps, elevations and names are carried into each feature's properties.

What changes when you convert GPX to GeoJSON

Every format stores different things, so a conversion is never perfectly loss-free. Here is exactly what carries over when you convert GPX to GeoJSON, and what to watch for.

WhatGPX → GeoJSON
GeometryKeptPoints, lines and polygons are preserved exactly, including multi-part shapes.
AttributesKeptEvery column and full field name moves from GPX into GeoJSON untouched.
Styling & labelsKeptNeither GPX nor GeoJSON stores visual styling, so there is nothing to lose, the geometry and data carry straight over.
Coordinate systemChangesGeoJSON is defined in WGS84 (EPSG:4326), so data is reprojected to lon/lat on the way out.
Elevation (Z)Kept3D Z values carry from GPX into GeoJSON wherever the source records them.
File structureKeptA single, self-contained .geojson file you can move around on its own.

Why convert GPX to GeoJSON?

GPX is the language of GPS devices and fitness apps. Your watch or handheld records a hike as waypoints, routes and tracks, then exports GPX. However, that XML does not drop cleanly into a web map. So people convert GPX to GeoJSON, the format the modern web-mapping stack speaks. Once the track is GeoJSON, you can render it directly in Leaflet, Mapbox GL or OpenLayers. For example, a Strava or Komoot ride becomes a line on your own site. GeoJSON is also plain text, so you can pass it through web APIs or version-control the route in Git.

Coordinate system handling

GPX is already defined in WGS84 longitude/latitude (EPSG:4326), so no guessing is needed on the way in.

GeoJSON is defined in WGS84 (EPSG:4326), so the output is reprojected to longitude/latitude, exactly what Google Earth and web maps expect. A quick CRS check before you download saves the classic "my GPX data is in the wrong place" surprise; the guide on coordinate systems and EPSG codes goes deeper.

What to check when converting GPX to GeoJSON

GPX carries limited attributes, so do not expect a rich table after conversion. A track holds coordinates, elevation and timestamps, little else. Also, GPX stores three geometry kinds: waypoints as points, routes and tracks as lines. Check which ones landed in your GeoJSON features. Both formats use WGS84 lon/lat, so coordinates line up. Then confirm your track became a LineString, not scattered points.

Which software opens the result

GPX files typically come out of Garmin, Strava, Komoot, QGIS, GPSBabel. Once you convert to GeoJSON, the file opens in web maps built on Leaflet, Mapbox GL or OpenLayers, and desktop tools like QGIS. The GeoJSON output follows the standard specification exactly, so those programs read it without any special import settings.

Troubleshooting GPX to GeoJSON

About the formats

A GPX file is what your watch or handheld records after a hike or ride: waypoints, an ordered route, and dense tracks of timestamped points. GeoJSON is what a web map wants to draw. This conversion turns that recorded outdoor data into features a Leaflet or Mapbox GL layer can render directly. In practice you export a track from Strava or Komoot, then reshape it here so JavaScript can read every point and property.

Frequently asked questions

Will my GPX track become a line in the GeoJSON?

Yes. A GPX track or route converts to a LineString feature, while waypoints become individual Point features. So a recorded ride stays a continuous line, not loose dots.

Can I load the GeoJSON straight into Leaflet or Mapbox?

Yes. GeoJSON is the native vector format for Leaflet, Mapbox GL and OpenLayers, so you can pass the output directly to an L.geoJSON or map source with no extra conversion.

How do GPX tracks and routes map to GeoJSON geometry?

Track segments and routes become LineString features, while waypoints become Point features. A track split into several segments can produce a MultiLineString. That means a single ride usually lands as one line you can style in Leaflet.

What happens to per-point data like elevation and timestamps?

GPX stores elevation and time on each track point, but a LineString keeps only the coordinates. Elevation can be carried as a third coordinate value, yet per-point timestamps usually do not survive as standard GeoJSON properties. Keep the original GPX if you need the full time series.

What can open a GeoJSON file after converting?

A GeoJSON file opens in web maps (Leaflet, Mapbox, OpenLayers) and QGIS. Because the output follows the standard specification, any tool that supports GeoJSON will read it without special settings.

Does converting GPX to GeoJSON lose any data?

No conversion is perfectly loss-free because each format stores different things, but geometry and attributes are preserved; only presentation-level styling (which GeoJSON does not store) is left behind.

Related converters

Related reading