GPX to KML Converter

Convert GPX tracks and waypoints to Google Earth KML — fully private

Free GPX to KML converter that runs 100% in your browser. Parses GPX waypoints, tracks and routes and emits KML Placemarks and LineStrings for Google Earth and Maps. Your location data never leaves your device — no upload, no server. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the difference between GPX and KML?

GPX is the GPS Exchange Format used by Garmin, Strava and most GPS devices. KML (Keyhole Markup Language) is Google's format for Google Earth and Maps. Both store points and lines but use different XML tags, so a conversion remaps the elements.

GPX (GPS Exchange Format) is what most GPS devices and apps export, while KML (Keyhole Markup Language) is what Google Earth and Google My Maps read. This free converter turns one into the other entirely in your browser, so you can view a recorded hike or drive on Google Earth without uploading your private location history to any server.

How the conversion works

The converter parses the GPX XML and rebuilds it as KML:

  1. The browser’s DOMParser reads the GPX document and finds every wpt (waypoint), trk (track) and rte (route).
  2. Each waypoint becomes a KML point Placemark: its lat/lon attributes and elevation become a Point with coordinates in lon,lat,ele order, and its name/desc carry across.
  3. Each track segment (trkseg) and route is flattened into an ordered list of points and emitted as a Placemark containing a LineString with all coordinates.
  4. The pieces are wrapped in a kml/Document envelope with the correct namespace.

KML uses longitude first (lon,lat,ele), the opposite of how GPX stores attributes (lat, lon) — the tool handles that swap for you.

What you can do with the KML output

Google Earth (desktop): open a .kml file directly with File → Open, or drag and drop it onto the Earth window. The track appears as a line drawn on the terrain; you can toggle terrain exaggeration to see the elevation profile dramatically. Waypoints appear as pinpoint icons at their coordinates.

Google My Maps: go to My Maps, create a new map, and click Import to upload the KML. Tracks and waypoints will appear as layers. My Maps lets you edit the style and share a public link, making it useful for sharing trip routes.

Google Maps via browser: Google Maps in the browser can render KML files through a URL-linked approach (hosting the KML file and linking to it), though direct KML import is not supported in the consumer Google Maps interface.

ArcGIS and QGIS: both GIS applications import KML natively. This makes GPX-to-KML conversion useful for incorporating GPS tracks into mapping and spatial analysis projects.

Other mapping tools: apps like Mapbox Studio, OpenLayers, and Leaflet-based applications can load KML, often with a plugin. The standard kml namespace and structure this tool outputs is compatible with all major KML parsers.

GPX vs KML: key format differences

FeatureGPXKML
EncodingPlain-text XMLPlain-text XML
Coordinate orderlat first, then lonlon first, then lat
TimestampsPer-point time elementNot supported per-point in LineString
Track representationtrktrksegtrkptPlacemark with LineString
Waypointswpt elementPlacemark with Point
Primary consumerGarmin, Strava, sport appsGoogle Earth, Google Maps, GIS

The most practically significant difference is the coordinate order. GPX uses lat="48.2082" lon="16.3738" as XML attributes. KML uses coordinates>16.3738,48.2082,0</coordinates> with longitude first. Tools that misread KML as lat-first will plot points on the wrong side of the world, which is why KML always wants longitude first and this converter handles the swap automatically.

Worked example

A minimal GPX waypoint like this:

<wpt lat="48.2082" lon="16.3738"><name>Vienna</name></wpt>

becomes a KML Placemark whose Point coordinates are 16.3738,48.2082,0. Note the reversed order. If your viewer shows points in the ocean off Africa, you are almost certainly feeding lat,lon into something expecting lon,lat — KML always wants longitude first.

Everything runs locally; your GPS data is never uploaded.

What survives the conversion and what doesn’t

GPX and KML overlap in geometry but diverge in metadata. Knowing what is lost prevents surprises downstream:

GPX elementKML resultPreserved?
wpt lat/lon/elePoint coordinatesYes
trkpt coordinates + eleLineString coordinatesYes
wpt/trk name, descPlacemark name/descriptionYes
trkpt time (per-point)No (KML LineString has no per-vertex time)
trkpt hr/cad/temp extensionsNo (Garmin TrackPointExtension is dropped)
Multiple trkseg in one trkFlattened into one LineStringMerged

The two big losses are timestamps and sensor extensions (heart rate, cadence, temperature, power). If you need time-animated playback in Google Earth, plain KML is the wrong target — you want KML with a gx:Track (the Google extension that carries when timestamps alongside coordinates), which some dedicated converters emit. For a static route line on the terrain, the standard LineString this tool produces is exactly right and more broadly compatible.

Common conversion problems and fixes

  • Points plotted in the ocean off Africa (0°N, 0°E area). Classic lat/lon-vs-lon/lat swap: a downstream tool read the KML as latitude-first. KML is always longitude-first; this converter emits the correct order, so the fault is in the consuming app’s import settings.
  • Empty output. The input had no wpt, trkpt, or rtept, or the paste omitted the <gpx> root. Some apps export a .gpx that is actually TCX or FIT under the hood — confirm the file really is GPX XML.
  • A giant straight line across the map. Two track segments got merged with a gap between them (e.g. you paused recording and resumed miles away). KML connects consecutive LineString vertices, so a recording gap becomes a drawn line. Split the track into separate files, or accept the connector.
  • Elevation looks flat in Google Earth. By default Google Earth may clamp the line to the ground. The ele values are in the coordinates, but you may need to set the Placemark’s altitude mode to absolute in Earth to see the vertical profile.

Sources and references

Maintained by the Gera Tools editorial team. The converter remaps GPX (lat-first attributes) to KML (lon-first coordinates) with DOMParser entirely in your browser; per-point timestamps are not represented in KML LineString geometry. Last reviewed 2026-07-02.