GeoJSON to GPX
Paste GeoJSON, get a GPX 1.1 file ready for Garmin, Strava, Komoot, AllTrails, and Locus Map. Points become <wpt>, lines become <trk> with one <trkseg> per segment. Everything runs in your browser.
GeoJSON to GPX
Before you start
You need a GeoJSON FeatureCollection, a single Feature, or a raw geometry. The converter only really makes sense for these geometry types:
Point&MultiPoint→ GPX waypoints (<wpt>).LineString&MultiLineString→ GPX tracks (<trk>with one<trkseg>per line).Polygon/MultiPolygon→ track of the outer ring(s). This is lossy — interior holes are dropped because GPX has no concept of polygons.
The conversion is fundamentally lossy in another way too: GPX has a fixed schema (name, desc, ele, time, etc.) and can't carry arbitrary feature properties. I serialize the rest into the <desc> tag as key: value lines so the data is at least visible inside Garmin / Strava popups.
Everything happens locally. No upload, no size limit beyond what your tab can hold in memory.
How to use it
- Paste your GeoJSON into the left pane, or drop a
.geojsonfile. - Click Convert.
- Check the status bar — it reports waypoint, track, and dropped-feature counts.
- Click Download .gpx and load the file into Garmin Connect, Strava, Komoot, AllTrails, BaseCamp, OsmAnd, or any other GPS tool that speaks GPX 1.1.
Example
Input (GeoJSON Feature with elevation):
{
"type": "Feature",
"properties": { "name": "Summit" },
"geometry": { "type": "Point", "coordinates": [-122.0, 37.5, 1430] }
}
Output (GPX 1.1):
<wpt lat="37.5" lon="-122">
<ele>1430</ele>
<name>Summit</name>
</wpt>
Notice the coordinate flip: GeoJSON is [lon, lat, ele] but GPX uses lat="…" lon="…" attributes. I handle the swap automatically and pull the third coordinate into <ele>.
Tips & common pitfalls
- Naming matters. Garmin Connect and most consumer apps display the
<name>tag prominently. Setproperties.nameon each feature so your tracks aren't a wall of "Untitled". - Elevation needs a third coordinate. If your GeoJSON points are
[lng, lat]only, the<ele>tag is omitted. Some devices then show altitude as zero — paste through a tool likegdalfirst if you need elevation from a DEM. - Timestamps come from
coordTimes. If your input has aproperties.coordTimesarray (one ISO-8601 string per vertex, the convention used bytogeojson), I emit a<time>tag inside each<trkpt>. Per-featureproperties.timeworks for waypoints. - Polygons are flattened. GPX has no polygon type. I write a track for the outer ring and silently drop interior holes — fine for things like park boundaries, wrong for things like hydrology with islands.
- Properties land in <desc>. Anything not in the GPX vocabulary becomes a
key: valueline inside<desc>. Most apps render this on tap; some show only the first line.
Troubleshooting
"No features" / output is just an empty <gpx> element.
Your GeoJSON parsed cleanly but contained no Point or LineString geometries — likely all null geometries or unsupported types like raw GeometryCollection with no children. Run the Validator first to confirm the structure.
Garmin Connect won't import the file.
Garmin sometimes rejects GPX with no <trk> at all (only waypoints) for activity import. Either upload it as a "course" or convert your points to a single LineString first.
The track shows but the elevation profile is flat.
Your input had only 2D coordinates. Add a third value to each coordinate, or use a DEM-augmented tool to enrich it before conversion.
Related tools
See also: if you need to do something adjacent on this site, try GPX to GeoJSON to turn GPX tracks into GeoJSON, Simplify GeoJSON to thin a dense track, or GeoJSON to KML to convert GeoJSON to KML for Google Earth.
Frequently asked questions
What GPX version does this output?
GPX 1.1 with the standard Topografix namespace. That's the version every modern device and service expects.
Are extensions (heart rate, cadence, power) supported?
Not on the output side. GPX extensions live in vendor-specific namespaces and the surface area is huge. If your GeoJSON has those properties they'll appear in the <desc> dump but not in dedicated extension tags.
How are MultiLineStrings handled?
One <trk> per feature, one <trkseg> per line in the multi. That preserves the gaps between segments — useful for tracks where the recording paused.
Will the output validate against the GPX 1.1 XSD?
For point and line conversions, yes. Polygon → track conversion produces valid GPX but may be semantically odd (a closed loop track). Run a quick check with xmllint --schema if you need certainty.
Is my data uploaded?
No. All conversion runs as plain JavaScript in your browser. You can disconnect your network and refresh — the page still works.