geojsonkit.org
GeoJSON utilities, in the browser
Say hi →

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

updated 25 April 2026

Drop a .gpx file, or

Before you start

You need one of the following:

GPX is just a specific flavor of XML. This tool expects a standard <gpx> root element. If you have a .kml or .kmz file from Google Earth instead, use the KML-specific converter linked below, as the internal structures are completely different.

Like my other tools, there is no file size limit beyond what your browser can handle. I've successfully converted 50 MB tracks with hundreds of thousands of points, though your browser might chug for a second while it generates the text output.

How to use it

  1. Paste your GPX text into the left pane, or drop a .gpx file directly onto the page.
  2. Click Convert to run the transformation logic.
  3. Check the right pane for the resulting GeoJSON — I've mapped waypoints to Point and tracks/routes to LineString.
  4. Click Copy to grab the JSON, or Download .geojson to save it for your project.
  5. If you want to see the result on a map, click the Viewer link in the header.

Example

Input (simplified GPX):

<wpt lat="45.52" lon="-122.67">
  <name>Portland</name>
</wpt>

Output (GeoJSON):

{
  "type": "Feature",
  "geometry": { "type": "Point", "coordinates": [-122.67, 45.52] },
  "properties": { "name": "Portland" }
}

Notice the coordinate flip: GPX uses lat, lon in its tags, but GeoJSON requires [longitude, latitude]. I handle this swap automatically.

Tips & common pitfalls

Troubleshooting

I get a "Missing or invalid XML" error.

GPX is XML, which is very picky. If you missed a closing tag or didn't copy the <?xml...?> header, the parser might fail. Try dropping the actual file instead of copy-pasting to avoid encoding or truncation issues.

The output "coordinates" array is empty.

This usually happens if the GPX file contains <trk> tags but no <trkpt> children, or if the namespace in the XML header is non-standard. Ensure your file actually has recorded location data.

Related tools

See also: if you need to do something adjacent on this site, try GeoJSON to GPX to push tracks back to a Garmin or Strava, Simplify GeoJSON to thin a dense track, or KML to GeoJSON to turn KML into GeoJSON.

Frequently asked questions

Is my GPS data uploaded to your server?

No. I use a library called togeojson that runs entirely in your browser. Your coordinates, timestamps, and private heart rate data never leave your computer. Check the privacy policy if you're curious.

How are track segments handled?

A <trk> with a single segment becomes a LineString. If your track has multiple segments (breaks in recording), I convert it to a MultiLineString to preserve those gaps correctly.

Why does the GeoJSON look "minified"?

By default, I output compact JSON to save space. If you need it to be human-readable for debugging, you can run the result through the GeoJSON Formatter tool to add indentation.

Does this support Garmin's Fitness (FIT) files?

Not directly. FIT is a binary format. You'll need to export your activity as a GPX from Garmin Connect or use a tool like GPSBabel to convert FIT → GPX before pasting it here.