KML (Keyhole Markup Language) is Google Earth’s format, while GPX (GPS Exchange Format) is what Garmin devices, Strava, Komoot and most GPS apps import. This free converter remaps one to the other entirely in your browser, so you can move a route out of Google Earth and onto your watch without uploading your private tracks anywhere.
How it works
The converter walks the KML document and rebuilds it as GPX:
DOMParserreads the KML and collects everyPlacemark, no matter how deeply nested insideFolderelements.- For each Placemark it inspects the geometry, including each child of a
MultiGeometry:- a
Pointbecomes a GPX waypoint (wpt), - a
LineStringbecomes a track (trk→trkseg→trkpt), - a
Polygonouter ring is exported as a track too, since GPX has no polygon type.
- a
- KML coordinate tuples are
lon,lat,ele; the tool splits them and writes GPX’s separatelatandlonattributes plus anelechild — handling the order swap for you. - Everything is wrapped in a GPX 1.1 root with the correct namespace.
The lon/lat coordinate swap
The single most common cause of GPX files appearing in the wrong place is the coordinate ordering difference between the two formats:
- KML stores each point as
longitude, latitude, elevation(x, y, z) - GPX uses named attributes
lat="..."andlon="..."(y first in attributes, but explicit)
If you convert KML to GPX by a naive text search-and-replace, the coordinates appear transposed — points land in their mirrored location on the globe. This converter reverses the order and assigns the values to the correct named attributes automatically.
What gets carried across
| KML element | GPX output |
|---|---|
Point Placemark | wpt waypoint with name and description |
LineString Placemark | trk with one trkseg of trkpt points |
Polygon (outer ring) | trk (GPX has no polygon type) |
MultiGeometry | Each child geometry converted separately |
| Elevation from coordinate | ele element on each waypoint or track point |
Placemark name | name element in the output |
Placemark description | desc element in the output |
Styles, icons, and extended data in KML have no GPX equivalent and are not included in the output — GPX is a slimmer format focused on geometry and metadata.
Worked example
A KML Placemark like:
<Placemark><name>Summit</name>
<Point><coordinates>16.3738,48.2082,171</coordinates></Point>
</Placemark>
becomes a GPX waypoint with lat="48.2082" lon="16.3738" and <ele>171</ele> — note that KML’s first number is longitude. If an imported route appears mirrored or in the wrong hemisphere, a lon/lat swap is almost always the cause, and this tool gets the order right.
All processing is local; your KML never leaves your browser.