GPX vs KML Files: Differences and Which to Use
November 4, 2026
GPX files record where a GPS device went: tracks, routes and waypoints, usually with timestamps. KML files describe things to show on a map: pins, lines, shapes, styles and labels. Use GPX to log or exchange movement data, including matching photos to a route. Use KML to present places in Google Earth or Google My Maps.
Both are plain-text XML formats, so you can open either in a text editor. They were built for different jobs, and that difference decides which one you want.
GPX vs KML at a glance
The table below covers the differences that matter in practice.
| GPX | KML | |
|---|---|---|
| Full name | GPS Exchange Format | Keyhole Markup Language |
| Main purpose | Store and exchange GPS data | Display geographic features on a map |
| Typical source | GPS watches, handheld units, fitness apps, phone tracking apps | Google Earth, Google My Maps, GIS software |
| Core content | Waypoints, routes, tracks | Placemarks, lines, polygons, overlays, styles |
| Timestamps | Standard optional <time> on each point |
Supported, but not on plain lines (see below) |
| Elevation | <ele> per point |
Optional third value in coordinates |
| Coordinate order | lat and lon as attributes |
longitude,latitude,altitude in one string |
| Styling (colors, icons) | None | Extensive |
| Compressed version | None standard (people zip files) | KMZ (zipped KML with images and icons) |
| Best for photo geotagging | Yes, because tracks carry time | Only if converted or if it holds timed points |
What is a GPX file?
A GPX file is an XML file that stores GPS data. It holds three kinds of objects: waypoints (single saved points), routes (planned sequences of points) and tracks (the path you actually travelled, recorded as a series of points).
Each track point has a latitude and longitude. Most also have an elevation and a time. A simplified track point looks like this:
<trkpt lat="51.5007" lon="-0.1246">
<ele>12.0</ele>
<time>2024-05-14T09:31:05Z</time>
</trkpt>
The time is in UTC, shown by the trailing Z. GPX is deliberately minimal. It says where and when, and leaves presentation to the app that opens it. The widely used version is GPX 1.1.
Devices and apps that commonly produce GPX include handheld GPS units, sports watches, cycling and running apps, and dedicated phone logging apps. Some devices record in other formats by default, so check the export options.
What is a KML file?
A KML file is an XML file that describes geographic features and how to display them. It began with Google Earth's predecessor, Keyhole, and is now an open standard maintained by the Open Geospatial Consortium.
A KML file can contain placemarks (pins with names and descriptions), lines, polygons, image overlays, custom icons, colors, folders and even 3D models and guided tours. A basic placemark looks like this:
<Placemark>
<name>Job site A</name>
<Point>
<coordinates>-0.1246,51.5007,0</coordinates>
</Point>
</Placemark>
Note the order: longitude first, then latitude. That is the reverse of how most people say coordinates, and it is a common source of pins landing in the wrong country.
KML is what you get when you export a map from Google My Maps or save a project in Google Earth. KMZ is the same content zipped into one file, often with icons and images bundled in.
Which format handles time better?
GPX handles time better for recorded movement, because every track point can carry its own timestamp as a normal part of the format. KML can store time, but not in the simplest line structure.
In KML, a placemark can have a timestamp or a time span. A plain line (LineString) is a single feature with no per-point times. Google's KML extensions include a gx:Track element that pairs times with coordinates, so timed paths are possible. But many KML files you will meet are just pins and shapes with no timing at all.
This matters for photos. A photo carries a capture time. To place it on a route, software looks up where you were at that moment. That only works if the file records position against time.
Which should you use to geotag photos?
Use GPX if you want to geotag photos from a recorded track. Photo-matching tools expect a track with timestamps, and GPX is the format GPS loggers and fitness apps produce.
The process works like this:
- Record a track on a GPS device or logging app while you take photos.
- Export it as GPX.
- Load the photos and the GPX file into a tool that compares each photo's capture time with the track.
- The tool writes the matching coordinates into each photo's EXIF GPS fields.
The most common failure is a clock mismatch. If the camera clock is a few minutes or hours off, or set to a different time zone from the GPX's UTC times, photos match the wrong points. Most matching tools let you apply a time offset. Check one or two photos on a map before you save the whole batch.
Geotagr supports GPX track matching in the browser. GPX and CSV import are paid features, listed on the pricing page. Photos are processed in your browser and are not uploaded to Geotagr's servers. I would not assume KML import is available, so convert KML to GPX or CSV first if that is what you have.
KML is the better choice when you want to show where photos were taken, not when you want to assign locations to them. Dropping pins for each photo location on a shareable map is a KML job.
Which should you use to share or present locations?
Use KML (or KMZ) to present locations visually. It lets you control pin icons, line colors, labels and descriptions, and it opens in Google Earth and imports into Google My Maps.
Practical examples:
- A real estate agent maps all listings in a neighborhood with custom pins.
- A contractor maps active job sites with a note on each.
- A field team marks inspection points on a shared map.
GPX can also be displayed in many mapping apps. But it will not carry your colors, icons or formatted descriptions the way KML does, and some apps ignore parts of it.
Can you convert between GPX and KML?
Yes. Many free tools convert in both directions, including desktop software such as GPSBabel and several online converters. Google Earth can open both formats and save as KML.
Conversion is not lossless, because the formats model data differently:
- GPX to KML: tracks become lines, waypoints become placemarks. Timestamps may be dropped or only kept if the converter writes timed paths. Elevation usually survives.
- KML to GPX: placemarks become waypoints, and lines become tracks or routes. All styling is lost. A line with no times becomes a track with no times, which cannot be used for photo matching.
If you plan to match photos, keep the original GPX file. Do not convert it to KML and back.
Before relying on a converted file, open it in a text editor and look for <time> entries. If there are none, the file cannot place photos by time.
What about CSV as a third option?
CSV is a simple alternative when you already have a list of locations. Each row can hold a file name or time with a latitude and longitude. It suits cases where you know which photo belongs to which place, such as a spreadsheet of addresses or job sites.
Use GPX when location depends on time (a moving track). Use CSV when location depends on the photo itself (a known list). Geotagr's CSV import is a paid feature too. For more on workflows with many photos, see How to Batch Geotag Photos.
How do you choose between GPX and KML?
Pick by what you need to do:
- Assign locations to photos from a walk, drive, ride or site visit: GPX.
- Record a trip with a GPS device or app: GPX.
- Share a styled map of places with clients or colleagues: KML or KMZ.
- Import places into Google My Maps or Google Earth: KML or KMZ.
- Store a planned route for a GPS device: GPX.
- Map photo locations after the fact: KML, using locations you already extracted.
- Tag a handful of photos by hand: neither; type coordinates or pick a point on a map. See How to Add GPS Coordinates to Photos Online.
What should you check after geotagging?
Check that the coordinates are actually in the photo files. The GPX or KML file is only the source. The photo's own metadata is what apps and platforms read.
Open a few finished photos in the free photo metadata checker to confirm the GPS fields are present and correct. Also remember that some platforms strip metadata on upload, so the data you wrote may not survive on the other end. Geotagging does not guarantee any effect on search visibility, and Google has not published how it uses photo metadata.
Frequently asked questions
Is GPX or KML better?
Neither is better overall. GPX is better for recorded GPS data with timestamps, such as a track used to place photos. KML is better for presenting places on a map with icons, colors and descriptions.
Can I use a KML file to geotag photos?
Only if it contains timed points, and only if your tool reads KML. Most KML files hold pins or untimed lines, which cannot be matched to photos by capture time. The safer route is a GPX track recorded during the shoot, or a CSV list if you know each photo's location.
Is a KMZ file the same as KML?
KMZ is a zipped KML file, often bundled with icons and images. The mapping content is the same. If a tool does not accept KMZ, you can unzip it and use the KML file inside, since KMZ is a standard zip archive.
Why are my KML pins in the wrong place?
The most likely cause is swapped coordinates. KML expects longitude first, then latitude, while most people write latitude first. If a pin lands in the ocean or on the wrong continent, check the order. The other common cause is a sign error on west or south values.
Do GPX files contain photos?
No. A GPX file contains only position data: points, routes, tracks and optional extras like elevation and time. Photos stay separate. Geotagging links the two by writing coordinates from the GPX into each photo's metadata.
Can I convert GPX to KML without losing data?
Not always. Positions usually convert well, but timestamps and device-specific extensions may be lost depending on the converter. Keep the original GPX as your master copy and convert a duplicate when you need KML.