Convert GPX to GeoJSON
Free, private and fast: everything runs in your browser and your GPX file is never uploaded.
GPX to GeoJSON: why convert
GPX is the standard way to get a recorded hike, ride or run out of a GPS device, Strava, Garmin Connect or Komoot. To show that trip on a Leaflet or MapLibre map, draw an elevation profile with D3, or load it into PostGIS or another database, GeoJSON is the format to have. This converter reads the waypoints, routes and tracks in the GPX and writes them as GeoJSON features, with the elevation of every point as the third coordinate. GPX files come with a long list of standard fields that are almost always empty, such as magvar, hdop or link2_type; only the fields that hold a value are kept, so the properties stay clean. Everything runs in your browser with GDAL, and the file is not uploaded.
How to convert GPX to GeoJSON
- Drop your .gpx file in the box, or click to choose it.
- Check the track on the map, and tick the box if you also want every track point with its time.
- Click Convert and download the GeoJSON file, or a zip with one file per kind of data.
What changes when you convert
One GeoJSON file per kind of data
A GPX can hold waypoints, routes and tracks at the same time, with different fields for each. They become separate files named waypoints.geojson, routes.geojson and tracks.geojson in a zip. A file that holds only a track, as most exports from Strava or a watch do, gives a single GeoJSON named after the GPX.
A track is a MultiLineString
A GPX track is made of segments, and a new segment starts when the recording was paused or the signal was lost. To keep those gaps, each track becomes one MultiLineString feature with a line per segment. A route is a single LineString and a waypoint a Point.
Elevation as the third coordinate
Elevations from the ele tags become the third value of each coordinate, as RFC 7946 allows, for example [12.504, 55.77, 38]. Web maps ignore it, but it is there for elevation profiles and 3D views. Points without elevation keep two values, and the elevation of waypoints is also kept as an ele property.
Time stamps need the track points
A line in GeoJSON has no place for a time per point. Tick "Also include every track point" to get an extra file, track_points.geojson, with one Point feature per recorded point and its time, elevation, track number and segment number as properties. That file can be large: a two-hour ride recorded every second has over 7,000 points.
Device extensions are not read
Heart rate, cadence, power and temperature that watches and bike computers store as extensions to each point are not part of the output. Waypoint names, descriptions, symbols and types are kept.
About the formats
GPX
GPX (GPS Exchange Format) is the XML format used by GPS devices and apps such as Garmin, Strava and Komoot. It stores waypoints, routes and tracks with optional time and elevation. Version 1.1 from 2004, published by TopoGrafix, is the one in use today.
- Waypoints are single points; a route is a planned line through a few points; a track is the recorded path, often thousands of points.
- Tracks can carry a time stamp and elevation for every point.
- Coordinates are always WGS84 latitude and longitude.
- GPX has a fixed set of fields (name, description, symbol, type and a few more); anything else must go into extensions.
GeoJSON
GeoJSON is a plain-text JSON format for geographic features, standardized as RFC 7946 in 2016. It is the native format of web maps such as Leaflet, MapLibre and Mapbox, and of many APIs.
- Coordinates are WGS84 longitude, latitude (in that order).
- Points, lines and polygons can be mixed in one file.
- Properties can be any JSON value, with no limit on field name length.
Frequently asked questions
Is my GPX uploaded?
No. Your browser converts the file on your own device. Nothing is sent to a server, which keeps your home address and training times private.
Why did I get a zip?
Your GPX contains more than one kind of data, for example waypoints and a track. Each kind becomes its own GeoJSON file. GeoJSON can mix points and lines in one file, so you can merge them later if your map needs a single file.
Can I open the GeoJSON in geojson.io or QGIS?
Yes. The output follows RFC 7946 with WGS84 longitude and latitude, which geojson.io, QGIS, Leaflet, MapLibre and GitHub all read.
What about route points?
The points of a route are already the vertices of the route line, so they are not written again as separate features.