Convert GeoJSON to GPX

This converter turns a GeoJSON file into a GPX 1.1 file for GPS devices and outdoor apps: points become waypoints, lines become tracks and polygons become a track along their outline. The GeoJSON is converted in your browser and is not uploaded. You choose which property becomes the name; other properties are kept as GPX extensions, which many devices ignore, and styles such as stroke colors are lost.

Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.

Key facts

GeoJSON to GPX: why convert

GeoJSON is what web maps, geojson.io, overpass turbo and most GIS scripts produce, but GPS devices and outdoor apps such as Garmin handhelds, OsmAnd, Locus Map or Gaia GPS import GPX. This page writes a GPX 1.1 file from your GeoJSON with GDAL, the open-source library behind QGIS, directly in your browser. Point features become waypoints and LineStrings become tracks you can follow, with heights kept when the coordinates have a third value. A GeoJSON has no fixed name field, so you can pick the property that devices should show as the name, for example title or label. The map preview shows what will be written before you download it.

How to convert GeoJSON to GPX

  1. Drop your .geojson or .json file in the box, or click to choose it.
  2. Check the map and pick the property to use for waypoint and track names.
  3. Click Convert to GPX and copy the file to your device or import it into your app.

What changes when you convert

Choose the name property

GPX has one name per waypoint or track, while GeoJSON features can have any properties. A property called name is used automatically; otherwise the page picks one whose name contains title or label, or the first text property, and says which. If you choose another property, a property called name is kept as name_orig. A property called description becomes the GPX desc; time and ele are written to the GPX elements of the same name.

Other properties go into extensions

Properties that have no GPX element of their own, such as length_km or surface, are written inside an extensions block. GDAL and QGIS read them back as fields, but most GPS devices and apps ignore them. Nested objects and lists are written as JSON text.

Polygons and multi-part features

GPX has no areas, so a polygon becomes a closed track along its outline, with one segment for each ring. A MultiLineString becomes one track with several segments, and each point of a MultiPoint becomes its own waypoint. Features without geometry and GeometryCollections cannot be written to GPX and are left out.

Styles, point times and heart rate

GPX has no colors or line widths, so simplestyle properties such as stroke or marker-color are only kept as extensions. A time property on a feature becomes the time of the waypoint. Lists with a value for each point of a line, as togeojson and many Strava or Garmin exports contain them (coordTimes and heartRates, or coordinateProperties with times, heart, cadences, power and temperatures), are written to the track points: the time as the time of each point, heart rate, cadence and temperature as a Garmin TrackPointExtension, which training apps such as Strava read, and power as power. A list whose length does not match the number of points is left out.

Coordinates and heights

GPX always uses WGS84 latitude and longitude. A standard GeoJSON is already in WGS84; an older file with a crs member in another system is converted. A third coordinate becomes the elevation; when all heights in the file are 0, the GPX gets none, so apps use their own elevation data instead.

About the formats

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.

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.

Frequently asked questions

How do I get the GPX onto my Garmin?

Handhelds such as the eTrex or GPSMAP read GPX files copied into the Garmin/GPX folder over USB. For watches and bike computers, import the file as a course in Garmin Connect and send it to the device from there.

Can I import the GPX into Komoot or Strava?

Komoot imports GPX tracks as planned tours. Strava accepts a GPX as a route, but as an activity only when every point has a time, which a GeoJSON drawn on a map usually does not have.

Will my waypoints keep their names?

Yes, from the property you choose. Some older GPS devices show only the first few characters of long names.

Is my GeoJSON uploaded?

No. GDAL runs in your browser and the GPX is written on your own computer. Nothing is sent to a server.

Can I convert GPX back to GeoJSON?

Yes, with the GPX to GeoJSON converter. Waypoints, tracks and routes become separate layers there.