GPX vs KML vs GeoJSON: Which Map & GPS Format Should You Use?

Exporting a hiking route, mapping delivery zones, or plotting data on a web map? You will run into three formats over and over: GPX, KML and GeoJSON. They all store geographic coordinates, but each was designed for a different world - GPS devices, Google Earth, and web developers respectively.

Here is what separates them and how to pick the right one.

GPX - the GPS and fitness format

GPX (GPS Exchange Format) is an XML format built around how GPS devices think: tracks (the breadcrumb trail you actually walked), routes (a planned path) and waypoints (marked points). It also records timestamps and elevation, which is why it is the native language of Garmin devices, Strava, Komoot and most fitness apps. Use GPX for recorded activity and anything headed to a GPS unit.

KML - the Google Earth format

KML (Keyhole Markup Language) is the XML format behind Google Earth and Google Maps. Beyond coordinates it can describe presentation - icons, colours, line styles, labels and pop-up descriptions - so your data looks a specific way when viewed. Its zipped variant, KMZ, bundles those assets together. Use KML when you want your points and shapes to display, styled, in Google Earth or Maps.

GeoJSON - the web and developer format

GeoJSON is a JSON format built for the modern web. It describes generic features - points, lines and polygons - each with arbitrary properties, and it drops straight into JavaScript, mapping libraries (Leaflet, Mapbox, OpenLayers) and databases. Use GeoJSON when you are building a map, an API, or any code that processes geographic data.

Quick reference

  • Recording a hike/ride, or loading a GPS device: GPX
  • Viewing styled data in Google Earth or Maps: KML
  • Building a web map or writing code: GeoJSON

The key mental model

GPX is about movement over time - it assumes tracks and waypoints. KML is about presentation - how things look on a globe. GeoJSON is about data - clean geometry and properties for machines to read. Match the format to the job and everything downstream gets easier.

How to convert between them

You will often need to move data from one world to another - a GPX track you want to show in Google Earth, or a KML file you need as GeoJSON for a web app. Conversion is instant:

What survives a conversion?

The coordinates - the actual points, lines and shapes - always transfer cleanly. What may not carry over is format-specific extras: KML's colours and icon styles have no home in GPX or GeoJSON, and GPX timestamps are not part of a KML placemark. That is not a bug; it reflects what each format was designed to hold. The geometry is always preserved.

Is it private to convert map data online?

Location data can be sensitive - a track can reveal where you live, train or travel. With PrivConvert, your files are never stored:

  • Conversions run entirely in server memory, never written to disk
  • Your file is deleted the instant the download is ready
  • All transfers use HTTPS encryption
  • No account, no tracking, no file storage

More detail on our why PrivConvert and security pages.

Geospatial converters:
GPX to GeoJSON GPX to KML KML to GeoJSON All data tools