GeoJSON is a universal web geodata format, GPX is specialized for GPS tracks and routes. GPX is simpler but limited to navigation.
| Criteria | GeoJSON | GPX |
|---|---|---|
| Geometry types | All types | Points, tracks |
| GPS devices | ✗ | ✓ |
| Data attributes | ✓ | ✗ |
| Timestamps | ✗ | ✓ |
| Web compatibility | ✓ | ✗ |
For web maps, storing polygons/lines/points, APIs.
For GPS devices, Strava/Komoot, hiking tracks.

GeoJSON was designed in 2008 by a working group of developers and standardised by the IETF as RFC 7946 in 2016. It encodes geographic features in JavaScript Object Notation, which made it the default exchange format of web mapping and of most geospatial APIs.
A typical file is a FeatureCollection: an array of features, each with a geometry (Point, LineString, Polygon or their Multi variants) and a free-form properties object. Coordinates are decimal longitude and latitude. There are no styles, no spatial index and no fixed schema — every feature may carry different properties.
Leaflet, MapLibre GL, OpenLayers and D3.js load GeoJSON directly; QGIS, ArcGIS Pro, GDAL/ogr2ogr, GeoPandas and PostGIS import it, and GitHub previews GeoJSON files on a map.
It is readable by humans, parsed by every programming language and needs no companion files. Properties can hold any number of attributes with long names and Unicode values, which makes the format ideal for web APIs and small to medium datasets.
Text encoding makes files big and slow once they reach millions of features, there is no spatial index, and the single fixed coordinate system means projected data must be reprojected. Mixed geometry types in one file confuse desktop tools that expect one type per layer.
osm2cdr writes one FeatureCollection holding every layer of the selected area. Each feature keeps its OpenStreetMap name, type and tags, plus a _layer property naming its source layer — roads, buildings, water, greenery or points of interest — so a single filter splits the data apart again.

GPX (GPS Exchange Format) was released by TopoGrafix in 2002, and the current version, GPX 1.1, dates from 2004. It is an open, lightweight XML schema for moving location data between GPS devices and software.
A GPX file holds three kinds of data: waypoints (single named points), routes (ordered lists of points to follow) and tracks (recorded paths made of segments of track points). Each point has latitude and longitude plus optional elevation, time, name and description; extensions add things such as heart rate.
Garmin BaseCamp and Garmin devices, Wahoo and Hammerhead bike computers, Strava, Komoot, OsmAnd, Locus Map, GPXSee and QGIS read GPX.
It is the common language of navigation devices and sports apps, so a file prepared on a computer reaches a watch or a handlebar unit without conversion. Time stamps make it the natural format for recorded activities.
GPX has no polygons, no styling and only minimal attributes, so an area becomes just its outline. A track is geometry, not turn-by-turn guidance, and files with very many points slow down small devices.
osm2cdr turns points of interest into waypoints that show up as markers on the device screen, and linear features into lines you can walk or ride along. Areas arrive as outlines only, point elevations are not filled in, and turn prompts are left to the navigator's own routing data.
At the most basic level, GeoJSON is a JSON-based open format for geographic features, while GPX is an XML format for GPS waypoints, routes and tracks. On disk, GeoJSON is plain UTF-8 JSON text; GPX is plain XML text.
Here is what the comparison table above means in practice, point by point:

In short: choose GeoJSON when the data feeds a web map, an API or a script. Choose GPX when the features have to end up on a GPS navigator, a bike computer or a sports app.
You want hiking paths and viewpoints in OsmAnd or on a Garmin watch. GPX is the format these apps and devices import without any conversion.
You are analysing the same paths by surface type, access rules or trail difficulty. GeoJSON keeps all OpenStreetMap properties, which GPX has no room for.
You are showing trails on a website and want to colour them by type. GeoJSON draws them in Leaflet with styling by tag, while GPX would need a plugin and offers only names.
GPX supports only points and lines, so converting GeoJSON polygons yields outlines or nothing, and properties shrink to a name and a description. Converting GPX to GeoJSON keeps the geometry, but time and elevation end up as properties or third coordinates depending on the tool. Keep in mind that osm2cdr's GPX is a set of waypoints and lines for the device, not a planned route with turn instructions.
If you plan a trip and analyse it afterwards, take both: load the GPX onto the device for navigation and keep the GeoJSON on your computer, where the full OSM tags let you check surfaces, access restrictions and points of interest along the way.
On osm2cdr, pick GPX for navigation devices, bike computers and outdoor apps. Pick GeoJSON for analysis, web maps and anything that needs the full set of OSM tags.
osm2cdr builds GeoJSON and GPX directly from OpenStreetMap data — there is no need to download raw OSM extracts or install conversion tools. The steps:
Converter pages related to GeoJSON and GPX explain each route in more detail:
GeoJSON is a JSON-based open format for geographic features, whereas GPX is an XML format for GPS waypoints, routes and tracks. In the comparison table, GeoJSON is ahead on data attributes and web compatibility; GPX is ahead on GPS devices and timestamps.
GeoJSON. It is readable by humans, parsed by every programming language and needs no companion files.
When GPS devices and timestamps matter most. It is the common language of navigation devices and sports apps, so a file prepared on a computer reaches a watch or a handlebar unit without conversion.
There is no dedicated GeoJSON-to-GPX converter page on osm2cdr. Both formats are exported directly from OpenStreetMap data: select an area once and run the export for each format you need.
GeoJSON files open in Leaflet, MapLibre GL, OpenLayers, QGIS, GDAL and GeoPandas. GPX files open in Garmin BaseCamp, Strava, Komoot, OsmAnd, GPXSee and QGIS.
GeoJSON is fixed by RFC 7946 to WGS 84 longitude and latitude, and osm2cdr follows the rule, so every feature is ready for web maps. GPX stores WGS 84 latitude and longitude, with optional elevation and time for every point.