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:
- The browser’s
DOMParserreads the GPX document and finds everywpt(waypoint),trk(track) andrte(route). - Each waypoint becomes a KML point
Placemark: itslat/lonattributes and elevation become aPointwithcoordinatesinlon,lat,eleorder, and itsname/desccarry across. - Each track segment (
trkseg) and route is flattened into an ordered list of points and emitted as aPlacemarkcontaining aLineStringwith all coordinates. - The pieces are wrapped in a
kml/Documentenvelope 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
| Feature | GPX | KML |
|---|---|---|
| Encoding | Plain-text XML | Plain-text XML |
| Coordinate order | lat first, then lon | lon first, then lat |
| Timestamps | Per-point time element | Not supported per-point in LineString |
| Track representation | trk → trkseg → trkpt | Placemark with LineString |
| Waypoints | wpt element | Placemark with Point |
| Primary consumer | Garmin, Strava, sport apps | Google 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 element | KML result | Preserved? |
|---|---|---|
wpt lat/lon/ele | Point coordinates | Yes |
trkpt coordinates + ele | LineString coordinates | Yes |
wpt/trk name, desc | Placemark name/description | Yes |
trkpt time (per-point) | — | No (KML LineString has no per-vertex time) |
trkpt hr/cad/temp extensions | — | No (Garmin TrackPointExtension is dropped) |
Multiple trkseg in one trk | Flattened into one LineString | Merged |
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, orrtept, or the paste omitted the<gpx>root. Some apps export a.gpxthat 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
elevalues are in the coordinates, but you may need to set the Placemark’s altitude mode toabsolutein Earth to see the vertical profile.
Sources and references
- GPX 1.1 schema (Topografix) — the source format’s
wpt,trk/trkseg/trkpt, andrteelements - Google — KML Reference — the
Placemark,Point, andLineStringelements and thelon,lat,elecoordinate order - OGC KML standard — KML as an open standard understood by Google Earth, QGIS, and ArcGIS
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.