Guide
Converting GPX, KML and GeoJSON: what each format stores and what a conversion keeps
Maps and devices speak different file formats. A running watch records GPX, Google Earth saves KML, and web maps such as Leaflet and Mapbox read GeoJSON. Moving a route from one to another is a common job, and this converter does it in your browser without uploading anything.
The three formats
GPX, the GPS Exchange Format, is XML. It holds waypoints (single named points), routes (planned sequences of points) and tracks (recorded paths made of segments of track points). Each point has a latitude and longitude as attributes and optionally a height and a time. KML, Keyhole Markup Language, is XML too, built around Placemark elements that hold a Point, a LineString or other shapes, with the position written as longitude, latitude and altitude separated by commas. GeoJSON is JSON, with features that have a geometry such as a Point, a LineString or a MultiLineString and coordinates in the order longitude, latitude, elevation.
How it is converted
The tool reads the input into a simple model of waypoints and tracks: each waypoint has a name, a position, an optional height and a description, and each track has a name and one or more segments of points with optional heights and times. It then writes that model in the format you choose. GPX routes are read as tracks, KML placemarks with a line become tracks and those with a point become waypoints, and a GeoJSON polygon is read as a line around its ring.
Choosing the output
GeoJSON suits web maps and code. A track with one segment becomes a LineString and a track with several becomes a MultiLineString. GPX is the format for GPS devices and fitness apps, and keeps times. KML is for Google Earth and similar viewers. The CSV option lists every point, with the type (waypoint or track), the name, the segment, the latitude and longitude, the height and the time, for use in a spreadsheet.
A worked example
Press Sample to load a GPX file with one waypoint, named Summit cairn, and one track of 61 points in a single segment, an out-and-back hill walk. The tool reports that it was read as GPX, with 1 waypoint, 1 track, 1 segment and 61 points. Switch the output to GeoJSON and you get a Point for the cairn and a LineString for the walk, with heights as the third coordinate of each position. Switch to KML to get two Placemarks, or to CSV to get a header and 62 rows.
What is lost
Each format has features the others lack. A GPX file can hold time stamps and extensions, such as heart rate or cadence from a watch, which GeoJSON and KML do not store in this conversion. KML carries styles, icons, folders and descriptions in HTML, and GeoJSON carries arbitrary properties; the converter keeps names, descriptions, positions, heights and GPX times only. Polygons become lines. If you need everything, keep the original file.
Large files
Long recordings can have tens of thousands of points. The browser can handle files of several megabytes, but a very large file may take a few seconds to read. If a file is too heavy, split it or simplify the track in another tool first. The tool reports clear errors, such as a position outside the valid range or XML that is not well formed.
Limits
The converter does not change the datum, which is WGS 84 in all three formats, and it does not simplify or smooth tracks. It does not edit or merge files. Positions are written to six decimal places, about 0.1 metre, and heights to two decimals.
Related tools
- GPX Analyzer reads the distance, climb and splits of a track.
- Lat Long Converter converts a single position between coordinate formats.
- UTM to Lat Long Converter moves between a metre grid and degrees.
- JSON Formatter tidies the GeoJSON you produce.
Checked against the current version of the GPX to GeoJSON Converter on .

