GPX to KML Converter
Turn a GPX track, route, and waypoints into KML that opens straight in Google Earth — pick the line color, width, opacity, waypoint color, and altitude mode. Runs entirely in your browser, no upload.
About this tool
Paste GPX XML and get a KML 2.2 document that opens in Google Earth and other KML-aware viewers. Tracks and routes become LineString placemarks, waypoints become Point placemarks, and the converter keeps useful metadata such as names, descriptions, timestamps, and elevation when those fields are present.
Use the styling controls to set the track/route line color, line width, line opacity, and waypoint icon color before exporting. The altitude mode controls how Google Earth interprets elevation values: clamp to ground for normal map overlays, absolute for 3D paths with sea-level altitude, or relative to ground for heights above terrain.
Worked example
Input:
<gpx version="1.1">
<metadata><name>Trip</name></metadata>
<trk><name>Morning Run</name><trkseg>
<trkpt lat="52.100" lon="5.100"><ele>10</ele></trkpt>
<trkpt lat="52.101" lon="5.102"><ele>12</ele></trkpt>
</trkseg></trk>
</gpx>
With the default red line, width 4, 80% opacity, and clamp-to-ground altitude mode, the output includes a KML <Document> named Trip, a shared <LineStyle> color of cc4444ef, and a <LineString> with coordinates 5.1,52.1,10 5.102,52.101,12.
Limits and edge cases
- The tool converts one GPX document at a time and returns plain KML text, not KMZ zip files.
- It reads standard
<trk>,<rte>, and<wpt>elements. Vendor extension data is ignored so the output stays portable. - KML colors use
aabbggrrbyte order; this tool converts from familiar CSS#RRGGBBand#RGBinputs for you. - Empty documents or GPX files with no track, route, or waypoint return a clear error instead of an empty KML file.
FAQ
Does this preserve tracks, routes, and waypoints?
Yes. GPX tracks (trk) and routes (rte) become KML LineString placemarks, while GPX waypoints (wpt) become Point placemarks. Names and descriptions are copied when the GPX file provides them.
Which altitude mode should I choose?
Use clamp to ground for normal map overlays. Choose absolute if the GPX elevation is metres above sea level and you want a 3D path. Choose relative to ground when the elevation values represent height above terrain.
Can this tool create KMZ files?
No. It returns standard KML text so you can inspect or save it directly. KMZ is a zipped KML package; if you need one, save the output as .kml first and package it separately.
Why do KML colors look different from CSS hex colors?
KML stores colors as aabbggrr: alpha first, then blue, green, and red. The form accepts CSS-style #RRGGBB or #RGB colors and converts them to the KML byte order automatically.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool gpx-to-kml "<gpx version='1.1'><trk><name>Morning Run</name><trkseg><trkpt lat='52.100' lon='5.100'><ele>10</ele></trkpt><trkpt lat='52.101' lon='5.102'><ele>12</ele></trkpt></trkseg></trk></gpx>"New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/gpx-to-kml/?gpx=%3Cgpx%20version%3D%271.1%27%3E%3Ctrk%3E%3Cname%3EMorning%20Run%3C%2Fname%3E%3Ctrkseg%3E%3Ctrkpt%20lat%3D%2752.100%27%20lon%3D%275.100%27%3E%3Cele%3E10%3C%2Fele%3E%3C%2Ftrkpt%3E%3Ctrkpt%20lat%3D%2752.101%27%20lon%3D%275.102%27%3E%3Cele%3E12%3C%2Fele%3E%3C%2Ftrkpt%3E%3C%2Ftrkseg%3E%3C%2Ftrk%3E%3C%2Fgpx%3E&line_color=%23ef4444&line_width=4&line_opacity=80&waypoint_color=%233b82f6&altitude_mode=clamp_to_ground&document_name=Falls%20back%20to%20the%20GPX%20metadata%20nameMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
