GPS File Formats Guide — GPX vs KML vs FIT
A comprehensive guide to GPS and fitness tracking file formats, their structures, use cases, and how to convert between them.
Introduction to GPS File Formats
Global Positioning System (GPS) devices and fitness trackers generate data in several file formats designed for different purposes. GPX is the standard interchange format for GPS devices, used by handheld GPS units from Garmin, Magellan, and others. KML is Google Earth's format for geographic visualization and annotation. FIT is Garmin's binary format for fitness and health data, storing not just position but also heart rate, cadence, power, and other biometric metrics. Understanding these formats is essential for anyone who works with GPS data, whether for outdoor recreation, fitness tracking, geographical analysis, or data visualization.
Each format has its strengths. GPX excels at representing routes, tracks, and waypoints in a clean XML structure. KML provides rich visualization capabilities with custom styles, placemark icons, and 3D features. FIT offers compact binary storage of high-resolution sensor data from fitness devices. Choosing the right format depends on your device, your analysis goals, and the software you plan to use.
GPX — GPS Exchange Format
GPX (GPS Exchange Format) is an XML-based open standard for sharing GPS data between different software applications and devices. It was developed by Garmin and is now maintained by Topografix. GPX files store three primary types of GPS data: waypoints (single geographic points), tracks (ordered sequences of points recorded by a moving GPS receiver), and routes (planned sequences of points for navigation). The GPX schema uses XML namespaces and includes optional extensions for altitude, time, satellite information, and sensor data.
GPX Structure
A GPX file begins with a <gpx> root element that specifies the version, creator application, and XML namespace. Waypoints are stored in <wpt> elements with latitude and longitude attributes. Tracks are stored in <trk> elements containing one or more <trkseg> (track segments), each containing <trkpt> (track points). Routes are stored in <rte> elements with <rtept> route points. Each point can include optional child elements for elevation (<ele>), timestamp (<time>), and name (<name>). GPX extensions allow adding heart rate, cadence, temperature, and other sensor data.
Common Uses of GPX
GPX is used extensively by outdoor enthusiasts to record hiking, cycling, and running routes. Garmin handheld GPS devices export tracks in GPX format. OpenStreetMap contributors use GPX to upload GPS traces. Navigation apps like Komoot, AllTrails, and Gaia GPS support GPX import and export. GPX is also the standard format for sharing geocaching locations and motorcycle tour routes.
KML — Keyhole Markup Language
KML (Keyhole Markup Language) is an XML-based format developed by Keyhole Inc. (later acquired by Google) for displaying geographic data in Google Earth and other Earth browsers. KML was adopted as an OGC (Open Geospatial Consortium) standard in 2008. Unlike GPX, which is focused on GPS position data, KML is designed for geographic visualization. It supports placemarks with custom icons, paths, polygons, ground overlays, 3D models, and time-based animations.
KML Features
KML placemarks (<Placemark>) can contain a name, description, icon style, and geometry (point, line string, polygon). Styles (<Style>) define the visual appearance of features including color, line width, icon scaling, and label placement. Folders (<Folder>) organize features hierarchically. Network links (<NetworkLink>) load remote KML content dynamically. The <gx:Track> extension supports GPS track data with timestamps for time-based animation. KML also supports extended data (<ExtendedData>) for attaching custom attributes to features.
When to Use KML
KML is the best choice when your goal is geographic visualization and map sharing. If you want to show a hiking route on Google Earth with colored trail segments, waypoint markers, and informational popups, KML is the ideal format. KML is also used for sharing geographic data in academic research, environmental monitoring, urban planning, and tourism. Google My Maps exports to KML, making it easy to share custom maps.
FIT — Flexible and Interchangeable Data Transfer
FIT (Flexible and Interchangeable Data Transfer) is Garmin's proprietary binary format for fitness and health data. Unlike GPX and KML, which are XML-based and human-readable, FIT files are compact binary files designed for efficient storage of high-resolution sensor data. FIT files are generated by Garmin fitness devices, including Forerunner watches, Edge cycling computers, Fenix multisport watches, and Vivo fitness trackers. The FIT protocol defines a flexible data structure where messages contain fields with defined types and units.
FIT Structure
A FIT file begins with a 12-byte file header containing the protocol version, profile version, and data size. The body consists of a sequence of records, each containing a message type and its fields. Common message types include File ID (device identification), Session (activity summary), Lap (segment information), Record (individual sensor data points), and Event (laps, pauses, and markers). Each record message contains fields for timestamp, position (latitude/longitude), altitude, heart rate, speed, cadence, power, temperature, and more. The binary encoding makes FIT files significantly smaller than equivalent GPX files with the same data.
Converting FIT to Other Formats
Because FIT is a binary format, it cannot be opened in a text editor or imported directly into many GPS applications. Converting FIT to GPX translates the GPS track data into the standard XML format while preserving waypoints and timestamps. Converting FIT to CSV extracts all data fields including heart rate, cadence, and power into a tabular format for analysis in Excel or Python. The ConvertPivot FIT to GPX and FIT to CSV tools handle these conversions while preserving as much sensor data as possible.
Comparison Table
| Feature | GPX | KML | FIT |
|---|---|---|---|
| Encoding | XML (text) | XML (text) | Binary |
| File size | Large | Large | Small |
| Human-readable | Yes | Yes | No |
| Waypoints | Yes | Yes (Placemarks) | Via events |
| Tracks | Yes (trkseg/trkpt) | Yes (gx:Track) | Yes (Record messages) |
| Routes | Yes (rte/rtept) | Yes (LineString) | No |
| Heart rate | Via extensions | Via extended data | Native |
| Cadence/Power | Via extensions | Via extended data | Native |
| Visual styling | None | Rich (colors, icons, 3D) | None |
| Primary use | GPS device data | Map visualization | Fitness tracking |
Which Format for Which Use Case
Choose GPX when you need to share GPS tracks between devices, upload routes to a navigation app, or archive raw GPS data. Choose KML when you want to visualize geographic data in Google Earth, create annotated maps for sharing, or overlay GPS tracks on satellite imagery. Choose FIT when you are working with Garmin fitness data that includes heart rate, cadence, or power metrics, and you need compact file storage. For general-purpose GPS data exchange, GPX is the safest choice due to its broad compatibility across devices and software platforms.
Converting Between GPS Formats
Converting between GPS formats is often necessary when switching devices, sharing data with others, or importing into analysis software. ConvertPivot offers dedicated tools for every conversion path. GPX to KML converts GPS tracks into Google Earth's KML format with proper styling. GPX to CSV extracts coordinates and timestamps into tabular format. FIT to GPX translates Garmin's binary data into the standard GPS exchange format. FIT to CSV exports all sensor data for spreadsheet analysis. CSV to GPX creates GPS track files from coordinate data. KML to GPX converts Google Earth placemarks and paths back to the GPS device format. Each converter preserves the relevant data while discarding format-specific features that lack equivalents in the target format.