LazyTools

🔒 Every tool runs in your browser — the files and values you enter are never uploaded to any server. How it works

🗺️ GPX to GeoJSON Converter

Paste or open a GPX file and get GeoJSON — the track as a LineString and waypoints as Points, in [lon, lat] order for web maps.

GPX → GeoJSON FeatureCollection

Rate this tool:
Anonymous — no account, no identifier

How the gpx to geojson converter works

The converter reads the GPX track points into a single GeoJSON LineString and turns any standalone waypoints (<wpt>) into Point features, all wrapped in a FeatureCollection. Crucially, it writes coordinates in GeoJSON's [longitude, latitude] order (the reverse of how GPX and most humans write them), and keeps elevation as the optional third value — so the output drops straight into Mapbox GL, Leaflet, Turf.js, PostGIS or any GIS.

The lon/lat ordering is the single most common GPX-to-GeoJSON mistake: GPX attributes are lat then lon, but the GeoJSON spec (RFC 7946) mandates [lon, lat]. This tool handles the swap for you, which is why hand-conversions so often plot points in the wrong hemisphere. It converts geometry and waypoint names; rich per-point metadata (heart rate, cadence extensions) isn't part of core GeoJSON and is left out. Everything runs locally.

Frequently asked questions

How do I convert GPX to GeoJSON?

Paste or open your GPX file and the tool outputs a GeoJSON FeatureCollection — the track as a LineString and waypoints as Points. Copy or download the .geojson result.

Does it get the coordinate order right?

Yes — GPX uses lat/lon but GeoJSON requires [longitude, latitude]. The converter swaps them automatically, which is the mistake that causes hand-converted points to appear in the wrong place.

What happens to elevation?

Elevation is preserved as the optional third coordinate value ([lon, lat, ele]), which GeoJSON permits and mapping tools accept.

Can I use the output in Leaflet or Mapbox?

Yes — the FeatureCollection is standard RFC 7946 GeoJSON, so it works directly in Leaflet, Mapbox GL, Turf.js, PostGIS and other GIS tooling.

Is my GPX uploaded?

No — the conversion runs entirely in your browser and works offline, so your track and its locations stay on your device.

Related file converters

From the blog