GPX files are the universal language of GPS devices. Whether you just finished a trail run on your Garmin watch, downloaded a route from Komoot, or exported an activity from Strava, you are almost certainly dealing with a .gpx file. GPX is great for storing raw GPS data, but it is not the most convenient format for web mapping or spatial analysis. That is where GeoJSON comes in. This guide explains what GPX is, why you might want to convert it to GeoJSON, and how to do it for free in seconds using the GeoDataTools GPX viewer.
What Is a GPX File?
GPX stands for GPS Exchange Format. It is an open, XML-based schema designed to store GPS data in a portable, interoperable way. The format was introduced by Topografix in 2002 and has since become the de facto standard for exchanging GPS data between devices, platforms, and applications.
A GPX file can contain three types of geographic data:
- Waypoints (
<wpt>): Individual named points of interest — a summit, a campsite, a trailhead. Each waypoint has a latitude, longitude, and optional elevation and name. - Tracks (
<trk>): A recorded path, typically from a GPS device logging your movement over time. Tracks are made up of track segments (<trkseg>), each containing a sequence of track points (<trkpt>) with latitude, longitude, elevation, and timestamp. - Routes (
<rte>): A planned path from A to B, consisting of route points. Unlike tracks, routes are typically created before travel rather than recorded during it.
Apps and devices that export GPX include Garmin GPS watches and cycling computers, Strava, Komoot, AllTrails, Wahoo, Suunto, Polar, and most dedicated outdoor navigation apps. If you have ever exported your workout history or downloaded a trail map, you have likely worked with GPX files.
Why Convert GPX to GeoJSON?
GPX is excellent at what it does — storing GPS data in a standard, human-readable format. But when you want to use that GPS data in a web application, a spatial database, or a modern GIS workflow, GeoJSON is almost always the better choice. Here is why:
- GeoJSON is the web standard. Every major web mapping library — Leaflet, Mapbox GL JS, OpenLayers, Deck.gl — has native GeoJSON support. You can load a GeoJSON file with a single function call and render it on a map without any parsing overhead.
- Simpler structure. GPX is verbose XML with multiple nested element types. GeoJSON is lean JSON — easier to read, easier to manipulate programmatically, and faster to parse in the browser.
- Works with spatial tools out of the box. QGIS, PostGIS, Turf.js, and most geospatial APIs accept GeoJSON directly. Converting your GPX track to GeoJSON means you can drop it straight into any of these tools without an intermediate conversion step.
- Easier to query and filter. GeoJSON properties are plain JSON objects. Filtering features by attribute, calculating distances, or merging datasets is far more straightforward than parsing XML nodes.
- Widely supported for sharing. GitHub renders GeoJSON files as interactive maps. Many APIs and third-party services accept GeoJSON as an input format. It is the lingua franca of modern geospatial web development.
If you are building a web map, importing data into a GIS tool, or simply want a format that is easier to work with, converting your GPX file to GeoJSON is the right move.
How to Convert GPX to GeoJSON Online
The fastest way to convert a GPX file to GeoJSON is to use the GeoDataTools app — a free, browser-based tool that handles the conversion instantly without uploading your file to any server. Here is how it works:
- Step 1 — Open the app. Navigate to GeoDataTools in any modern browser. No account creation, no email address, no payment required.
- Step 2 — Upload your GPX file. Drag and drop your
.gpxfile onto the map area, or click the upload button to browse your local files. The file is read directly in your browser — it never leaves your device. - Step 3 — View your GPS track on the map. Your track appears immediately as an interactive layer on the map. You can zoom in to inspect individual segments, click on track points to see elevation and timestamp data, and pan freely around the route.
- Step 4 — Export as GeoJSON. Use the export button to download your GPS data as a GeoJSON file. The output preserves all track points, waypoints, elevation data, and timestamps as GeoJSON feature properties.
The whole process takes under thirty seconds, even for long multi-hour activities with thousands of track points. You can also explore the all conversion tools page for other format options.
What Happens to Your GPX Data?
This question matters — especially when you are dealing with GPX files that contain more than just a running route. Modern GPS devices and fitness apps record a wealth of personal data alongside your location: heart rate, cadence, power output, sleep patterns, and in some cases health metrics that fall under medical data protection laws.
Strava GPX exports, for example, can include heart rate data recorded by your chest strap or wrist sensor. Garmin exports may include running dynamics, respiration rate, and stress scores. This is sensitive data you probably do not want sitting on a third-party server.
With GeoDataTools, your GPX file never leaves your browser. The entire conversion happens locally using browser-native APIs. No file is transmitted to a server. No data is stored, logged, or analysed. The moment you close the tab, every trace of your file is gone. This is not a privacy policy promise — it is how the architecture works. There is no server to send data to.
This makes GeoDataTools safe to use with personal fitness data, proprietary survey data, or any GPX file you would not want handled by a third-party service.
Exporting GPX from Popular Platforms
Before you can convert a GPX file, you need to export one. Here is how to get your GPX data out of the most commonly used platforms:
- Strava: Open the activity you want to export. Click the three-dot menu (more options) on the activity page and select Export GPX. Strava exports a full GPX file including GPS track points and, if recorded, heart rate data. You can also export your entire archive from Settings > My Account > Download or Delete Your Account > Request Your Archive.
- Garmin Connect: Open the activity in Garmin Connect (web or app). Click the gear icon and choose Export to GPX. Garmin exports include all recorded data channels — elevation, heart rate, cadence, and device-specific metrics.
- AllTrails: On the trail detail page, click Download Track (available to AllTrails+ subscribers). The download provides a GPX file of the official trail route. Recorded activities can be exported from your profile under Completed Trails.
- Komoot: Open your tour in the Komoot web app. Click the download icon and select GPX Track. Komoot exports include the planned or recorded route geometry and elevation profile.
- Wahoo / Suunto / Polar: Each of these platforms has an export option in the activity detail view — typically under a share or export menu. The output is a standard GPX file compatible with any converter.
GPX Structure Explained
Understanding the basic structure of a GPX file helps you know what data survives the conversion to GeoJSON and what to look for in your output.
A typical GPX track segment looks like this:
<trk>
<name>Morning Run</name>
<trkseg>
<trkpt lat="51.5074" lon="-0.1278">
<ele>24.5</ele>
<time>2024-03-15T08:32:10Z</time>
</trkpt>
<trkpt lat="51.5076" lon="-0.1275">
<ele>25.1</ele>
<time>2024-03-15T08:32:15Z</time>
</trkpt>
</trkseg>
</trk>
Each <trkpt> element represents a single GPS fix. The lat and lon attributes give the position. The <ele> child element stores altitude in metres. The <time> element records when the point was captured, in UTC ISO 8601 format.
Track segments (<trkseg>) allow a single track to contain gaps — for example, if you paused recording and restarted. Each segment becomes a separate LineString in the GeoJSON output, preserving the gap rather than drawing a straight line across it.
Extensions (<extensions>) are used by device manufacturers to store additional data like heart rate, cadence, and power. These are typically preserved as properties in the converted GeoJSON, though the exact field names depend on the originating device.
Using Your GeoJSON Track in Web Maps
Once you have your GPX data in GeoJSON format, you can use it in any number of tools and frameworks. Here are some common destinations:
-
Leaflet: Load your GeoJSON file with
L.geoJSON(data).addTo(map). Leaflet renders LineString features as polylines and Point features as markers automatically. You can pass a style function to customise colours and stroke width based on feature properties. -
Mapbox GL JS: Add your GeoJSON as a source with
map.addSource('track', { type: 'geojson', data: yourGeoJSON }), then add a layer referencing that source. Mapbox GL JS supports data-driven styling, so you can colour-code your track by elevation or speed. -
QGIS: Use Layer > Add Layer > Add Vector Layer and select your
.geojsonfile. QGIS imports GeoJSON natively — no plugin required. From there you can symbolise the track, calculate statistics, perform spatial joins, and export to any format QGIS supports. - GitHub: Commit your GeoJSON file to any public GitHub repository. GitHub automatically renders GeoJSON files as interactive maps in the file viewer — a useful way to share routes and tracks without building a dedicated map page.
- Observable / Jupyter: GeoJSON is the natural format for exploratory geospatial analysis in notebook environments. Libraries like Vega-Lite, Plotly, and Folium all accept GeoJSON directly.
Whether you are building a fitness dashboard, visualising a hiking route, or analysing GPS data at scale, starting from GeoJSON keeps your workflow clean and dependency-light. If you also work with KML files from Google Earth, check out our KML viewer online guide for a similar walkthrough.