GPX to GeoJSON
Paste GPX or drop a .gpx file, get GeoJSON. Waypoints become Point features, tracks become LineString or MultiLineString features. The result is saved to your session — open the viewer next to see it on a map.
GPX to GeoJSON
What this tool does
It turns a GPX file — the XML that GPS devices, Strava, Garmin Connect, and phone tracking apps export — into a GeoJSON FeatureCollection you can drop into a map library, a database, or any of the other tools on this site. Paste the GPX text or drop a .gpx file, click Convert, and the right pane fills with GeoJSON.
The intent it closes: "I have a recorded track or a set of waypoints, and I need it as GeoJSON." Waypoints become Point features and tracks become LineString (or MultiLineString) features. If you need to go the other way, GeoJSON to GPX emits a GPX 1.1 file instead.
How this tool works
One click runs the conversion, entirely in your browser. The result is also saved to your session, so the Viewer and Validator can pick it up without a re-paste.
1. Parse the GPX
Your text is read as XML. When the bundled toGeoJSON library has loaded, it does the parsing; if it hasn't, a built-in DOM fallback walks the document directly. Either way, malformed XML — a missing closing tag, a truncated paste — stops the run and the status bar shows Error: … instead of writing output.
2. Build features
Each <wpt> waypoint becomes a Point feature, taking its name from the waypoint's <name> tag. Each <trk> track becomes a LineString when it has a single <trkseg> segment, or a MultiLineString when it has several — so a recording split by pauses keeps its gaps. Coordinates are read from the lon and lat attributes of each <trkpt> and <wpt>; any point with non-finite coordinates is dropped.
3. Emit GeoJSON
The features are wrapped in a FeatureCollection and written out as JSON. Note the coordinate order: GPX stores lat and lon as separate attributes, but GeoJSON requires [longitude, latitude] — this tool puts them in that order automatically. The status bar reports Converted. Features: N, and Download saves the result as converted.geojson.
Example
Input (simplified GPX):
<wpt lat="45.52" lon="-122.67">
<name>Portland</name>
</wpt>
Output (one feature in the collection):
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-122.67, 45.52] },
"properties": { "name": "Portland" }
}
The lat/lon attributes come back out as [-122.67, 45.52] — longitude first, then latitude.
Tips & common pitfalls
- Coordinate order is the usual gotcha. If your points land in Antarctica when they should be in Europe, the latitude and longitude were probably swapped upstream. Standard GPX is
lat/lon, and this tool always emits[lon, lat]— open the Viewer to sanity-check the placement. - Empty output means no usable points. A
<trk>with no<trkpt>children, or waypoints withoutlat/lonattributes, produces a feature-less collection. Make sure the file actually has recorded coordinates. - Massive tracks (tens of thousands of points) can make web maps laggy. If the output is huge, run it through Simplify GeoJSON afterward to prune vertices.
- Coming from Google Earth? A
.kmlor.kmzfile is a different structure entirely — use KML to GeoJSON for those.
Troubleshooting
I get an "Error: …" message.
GPX is XML, which is picky. A missing closing tag, a dropped <?xml…?> header, or a truncated copy-paste will fail the parse. Try dropping the actual .gpx file onto the page instead of pasting, to avoid encoding or truncation issues.
The output has no features.
This happens when the file has <trk> tags but no <trkpt> points inside them, or waypoints missing their lat/lon attributes. Points with non-finite coordinates are also filtered out. Confirm the file contains real location data.
My points are in the wrong place.
Almost always a latitude/longitude swap in the source. GeoJSON is [longitude, latitude]; this tool follows that. Load the result in the Viewer to confirm where the points actually fall.
FAQ
Is my GPS data uploaded to a server?
No. The conversion runs entirely in your browser via JavaScript — your coordinates and timestamps never leave your machine, and the page works offline once loaded.
How are track segments handled?
A <trk> with a single <trkseg> becomes a LineString. If the track has multiple segments — say, breaks where recording paused — it becomes a MultiLineString so those gaps are preserved.
Why does the GeoJSON look "minified"?
The output is compact by default. To make it human-readable, run the result through the GeoJSON Formatter to add indentation.
Does this support Garmin FIT files?
Not directly — FIT is a binary format. Export your activity as GPX from Garmin Connect, or use a tool like GPSBabel to convert FIT → GPX first, then paste that here.