Guides ·

How to convert KML to GPX for a GPS device

You planned a walk in Google Earth or Google My Maps and saved it as KML, but your GPS watch, handheld or hiking app wants GPX. This guide explains what a GPX file holds (tracks, routes and waypoints), how a KML maps onto it, and what to check before you rely on it, using the Tongariro Alpine Crossing in New Zealand.

Drop your KML or KMZ into the free unmake KML to GPX converter and get a checked GPX for your GPS app.Try it on your own file
The unmake KML to GPX converter with the Tongariro Alpine Crossing: the line and six waypoints on the map, 1 line and 6 points, 12.23 mi, and the result tongariro-alpine-crossing.gpx, 168 KB, with 1 document description not carried over and the checks
The Tongariro Alpine Crossing in the KML to GPX converter. Route and points © OpenStreetMap contributors (ODbL); map © OpenStreetMap contributors.

KML draws a map, GPX goes on the device

KML is made for showing things on a map: placemarks, paths and areas with colours and icons. GPX is the usual exchange format for GPS devices and apps. Version 1.1 is an XML schema published by TopoGrafix.

Both store positions as longitude and latitude, so converting is mostly sorting each KML shape into the right GPX element.

Tracks, routes and waypoints

A GPX file can hold three kinds of things. The GPX 1.1 schema describes a track as an ordered list of points describing a path. It is the line you walked, or plan to walk, with every bend recorded point by point. A track can be split into segments, for example where a GPS lost its signal.

A route is an ordered list of waypoints: the turn points leading to a destination. It is shorter, and how your device fills the way between turn points depends on the device and its settings.

A waypoint is a single named spot, such as a summit, a hut or a car park. Waypoints are not part of any line; they sit on their own.

GPX holds three things: a track (trk) records every bend point by point, a route (rte) lists a few turn points, waypoints (wpt) are named spots
The three things in a GPX file. A KML path becomes a track; a KML point becomes a waypoint.

How each KML shape becomes GPX

A KML path (a LineString) becomes a track; a path in several parts becomes one track with several segments. A KML placemark with a single point becomes a waypoint with its name and description. Extra data fields stay behind, and the converter says so: for our Giza demo KMZ it reported "Names kept; 8 data values (pharaoh, kind) have no place in GPX and are left out."

A KML polygon, an area outline, has no GPX form at all. The unmake converter warns before you download that GPX has no polygons, says how many will be left out, and leaves them out. If you drew your route as a closed shape, draw it again as a path.

The unmake converter writes tracks, not routes. For a line drawn on a map that is the safer choice, because a track keeps the line exactly as you drew it.

Elevation and time

A KML coordinate can have a third value, the height. Paths drawn by hand in Google Earth or My Maps usually have none, or 0. A GPX made from such a path has no real heights either (none, or 0 m at every point), so your app shows a flat profile, or fills in heights from its own terrain data if it can.

Times work the same way: a planned path has no timestamps, so no speed or duration until you record the real walk.

Check the file before you rely on it

Look at the converted file on a map before the trip. Count the waypoints, read their names and compare the length with the official figure. Names like Mangatepōpō should keep their special characters.

A file is not a safety plan. For mountain walks, read the official page for the route on the day: closures, weather and parking change.

Converting in the browser

The unmake KML to GPX converter opens a KML or KMZ in your browser, draws it on a map and counts the lines and points with their length. A track panel with an elevation profile appears only for real recorded tracks, with times or changing heights.

Press Convert to GPX, read the check, which compares the GPX with the KML feature by feature and coordinate by coordinate, and download the file. Then import it into your GPS app or device.

The KML to GPX converter on a phone: the crossing on the map with 7 features, 1 line and 6 points, 12.23 mi, then the checked GPX ready to download
The same conversion on a phone, 390 px wide. Route © OpenStreetMap contributors (ODbL).

A worked example: the Tongariro Alpine Crossing

  1. We built tongariro-alpine-crossing.kml from OpenStreetMap: the crossing as one path of 3,502 points, from Mangatepōpō to Ketetahi, plus six named points: the start, Soda Springs, Red Crater, Emerald Lakes, Blue Lake and the end. It has no heights.
  2. Drop it into the KML to GPX converter. The panel reads 7 features: 1 line and 6 points, 12.23 mi. Details gives the file size as 77 KB and the line as 12.23 mi (19.68 km), close to the 19.4 km recorded in OpenStreetMap's route data.
  3. There is no track panel: with no times and no heights, the tool treats the path as a planned line, not a recorded track.
  4. Press Convert to GPX. The panel shows tongariro-alpine-crossing.gpx, 168 KB. A Not carried over line names the KML's document description, then three checks: 7 features, all 3,508 coordinates (largest difference 0.000 m) and 7 of 7 attribute values.
  5. Open the GPX in a text editor: 6 waypoints (wpt), then one track (trk) with one segment (trkseg) of 3,502 track points. There is no route (rte) and no elevation (ele). Mangatepōpō keeps its macron.
  6. The real walk is not flat. The Department of Conservation gives the start at 1,120 m, Red Crater at 1,886 m and the Ketetahi end at 760 m, so expect a climb in your app only if it adds terrain heights.

Common mistakes

Questions

What is the difference between a GPX track and a route?

A track is a detailed line, point by point. A route is a short list of turn points that the device joins up. The unmake converter writes tracks.

Why does my GPX have no elevation?

Because the KML had none. Paths drawn by hand in Google Earth usually have no heights; many apps can add them from terrain data.

Where did my polygons go?

GPX has no areas, so polygons are left out; the converter says how many.

Can I convert a KMZ to GPX?

Yes. The converter takes KML or KMZ and writes the same GPX tracks and waypoints.

Sample file: tongariro-alpine-crossing.kml (OpenStreetMap relation 104369 and six named points, put together as KML by unmake) · ODbL 1.0, © OpenStreetMap contributors

Sources

Drop your KML or KMZ into the free unmake KML to GPX converter and get a checked GPX for your GPS app.Try it on your own file