If you spend time outdoors hiking, cycling, or exploring new places, you might come across KML files. These files are another popular way of storing and sharing routes, tracks, and waypoints, alongside the widely used GPX format. You may also have seen KML files while using Google Earth or Google My Maps, since KML (short for Keyhole Markup Language) was originally developed for Google Earth.
KML format was created to visualize geographic data on a map. While it started in the Google ecosystem, KML has since been adopted by many other programs, which makes it a widely supported format today.
For outdoor enthusiasts, this means that KML files can be used much like GPX files — to plan routes, share tracks with friends, or keep waypoints saved for future adventures. And with apps like GPX Viewer, GPX Viewer PRO and Trackbook, you can easily open and view KML files on the map, making them a practical tool for navigating the outdoors.
How tracks and waypoints are stored in KML?
KML files are built like a structured list, where different tags describe locations and paths on a map. The format is based on XML-based format, which basically means it’s written in a text format that is both human-readable and machine-readable, so it can be opened by many different apps. A KML file may contain such geographic data as paths (lines), points, shapes (polygons), overlays and 3D models.
One of the key tags in KML is the <Placemark> tag, which represents individual map features such as a point, a path, or even an area. Using this tag, you can create both waypoints and tracks (or routes):
- Waypoint (marked with <Placemark> and <Point> tags): this is a single coordinate stored inside a <Point> tag. A waypoint marks one specific location on the map, such as a campsite, viewpoint, or parking spot.
- Track or route (marked with <Placemark> and <LineString> tags): this is a connected list of coordinates that draws a path on the map. Each coordinate is written as longitude, latitude, and sometimes elevation. Together, they form the line of your hike, bike ride, or drive.
Just like in GPX files, tracks and waypoints in KML have track and waypoint names and descriptions to make them easier to recognize when you open the file.
Applications like GPX Viewer, GPX Viewer PRO, or Trackbook display data from a KML file graphically on a map. And because KML is a text document, you can even open it in a regular text editor to see the coordinates written out.
What about KMZ files?
Sometimes, instead of .kml, you’ll get a file ending in .kmz. Don’t worry, it’s almost the same thing.
A KML file is a plain text file, basically a list of coordinates, waypoints, and instructions for how to display them on the map. You can include a link to an image in a KML, but the image itself isn’t stored inside the file. That means if you share just the KML with a friend, those linked images might not show up on their device.
A KMZ file, on the other hand, is a zip folder. It contains:
- the main KML file with all your tracks, routes, or waypoints
- plus any attached images or custom waypoint icons stored alongside it
This way, when you send someone a KMZ, the map data and the images stay linked, so nothing gets lost along the way. That’s why KMZ is the better choice if you’ve added photos, custom icons, or overlays to your route, it ensures your file looks the same for whoever opens it. However, the simplest way to create or edit a KML file is by using apps like Trackbook or GPX Viewer PRO, which let you see your tracks and waypoints directly on a map as you make changes.
What’s the difference between GPX and KML files?
GPX files are designed to be simple and universal, mainly storing the essentials: waypoints, tracks, and routes. Because of this straightforward structure, GPX is widely supported across GPS devices and outdoor apps, making it the go-to format for recording and sharing hikes or bike rides.
KML, on the other hand, goes beyond just coordinates. It is designed for detailed geographic visualization and presentation and has a more complex structure. KML files support rich styling and can describe complex map elements such as polygons for marking areas, or even 3D objects when used in tools like Google Earth.
If styling is important for your tracks — for example, if you’ve set custom colors — saving your tracks as a KML file ensures that these styles are preserved when you open the file again. With GPX Viewer PRO, you can export your tracks and waypoints in GPX, GPX, KML or KMZ formats, this gives you the flexibility to choose the format that best preserves your data and styling.
KML and KMZ files may sound a bit technical, but at their core they are just tools to help you explore and share the outdoors. Whether you use GPX or KML, both formats give you the ability to relive your adventures, keep your data organized, and plan the next trip with confidence. And with apps like GPX Viewer, GPX Viewer PRO, or Trackbook, opening these files is as simple as looking at a map.
Check these links if you want to learn more details about KML files:
https://developers.google.com/kml/documentation/kmlreference
https://www.uavsphere.com/post/beginner-s-guide-to-kml-files-what-they-are-and-how-to-build-one
https://www.uavsphere.com/post/beginner-s-guide-to-kml-files-what-they-are-and-how-to-build-one