GPX is what GPS devices and outdoor apps write. KML is what Google Earth reads. Google Earth on the web and on phones imports KML and KMZ files, but according to Google's documentation it does not take GPX, which has to be converted first. Upload the .gpx file above and you get a KML 2.2 file with your waypoints, the line of the track and every recorded point with its time.
Do you need to convert at all?
Not always. Google Earth Pro on a desktop computer opens GPX itself: drag the file into the window. Google My Maps imports GPX directly as well. Conversion is needed for Google Earth in the browser, on Android and on iOS, for programs that read only KML, and when you send a route to someone who will simply open it in Google Earth. Our converter works without installing anything, on a phone too, and takes 10 files at once.
What the KML contains
The file is organised in folders, which Google Earth shows as a tree you can switch on and off:
- Waypoints. One placemark per GPX waypoint, with its name.
- Tracks. Each track gets a folder with its own name and a summary: distance, lowest and highest altitude, minimum, maximum and average speed, start and end time.
- Points. Inside the track folder there is a placemark for every track point, named after the track with a running number. Each one carries a time stamp and a balloon with coordinates, altitude, time, and the speed and heading from the previous point. Heart rate and cadence stored in the GPX with the Garmin extension are listed there as well.
- Path. The track drawn as one line, 6 pixels wide, in a semi-transparent light blue. It is draped over the terrain. The altitudes are stored in the coordinates but are not used to lift the line.
- Routes. GPX routes are written the same way into a folder of their own.
The whole document is named GPS device, which is the label you will see in the list of places after import.
What changes or gets lost
- Units in the balloons. The summary and point descriptions are written in feet and miles per hour. The coordinates themselves stay in decimal degrees and metres, as KML requires.
- Time. It is kept on the point placemarks. The line has no time information.
- Sensor data as text only. KML has no standard fields for heart rate or cadence, so they exist only as text in the balloons. Training software will not read them from a KML.
- Icons. The placemark icons are links to images on Google's servers. A program working offline shows its own default symbol.
- No clean way back. Convert our KML to GPX again and each point placemark returns as a waypoint, while the line comes back as a track named Path without time stamps. Keep the original GPX.
Common problems
The KML is many times larger than the GPX
Every track point is stored twice, once in the line and once as a placemark with a description. That is about 0.8 kB per point. A recording of 6,000 points, less than two hours at one point per second, already reaches 5 MB.
Google My Maps rejects the KML
My Maps accepts KML and KMZ up to 5 MB unzipped, and other file types up to 40 MB. For a long recording import the GPX itself there instead of the KML.
Google Earth imports the track as a data layer
Google Earth on the web imports up to 10,000 features and 250,000 vertices as editable map features. Every track point in our KML is a feature, so a longer recording goes over that limit and Google Earth retries it as a read-only data layer.
KML or KMZ?
KMZ is the same KML packed in a ZIP archive under the name doc.kml. Because KML is repetitive text, it compresses well. Choose KMZ as the target format when the file is going into an e-mail. Google Earth opens both.
The flight or climb is drawn flat on the ground
That is the draped line described above. The altitude of every point is in the file and in the balloons, but the path follows the terrain model of Google Earth.
GPX and KML side by side
| GPX | KML | |
|---|---|---|
| Origin | TopoGrafix; GPX 1.0 in 2002, 1.1 in 2004 | Keyhole, Inc., later Google; OGC standard since 2008 |
| Purpose | exchange of GPS data | display of geographic data in an Earth browser |
| Content | waypoints, routes, tracks | placemarks, lines, polygons, overlays, folders, styles |
| Coordinates | latitude and longitude as attributes, elevation separately | longitude, latitude, altitude in one tuple |
| Appearance | left to the program | colours, line widths and icons stored in the file |
KML was created by Keyhole, Inc., the company Google acquired in 2004 and whose viewer became Google Earth. Google later submitted the format to the Open Geospatial Consortium, which adopted KML 2.2 as a standard on 14 April 2008. The Library of Congress keeps a format description of it. GPX 1.1 dates from 9 August 2004. More about the two formats: GPX and KML. If your recording is a TCX workout, convert it with TCX to GPX first.