Why FIT files get corrupted
A FIT file that Garmin Connect or Strava refuses usually did not fail at random. It was cut off before the device finished writing it.
How a FIT file is built
- A header at the start, which includes a field for the size of the data that follows.
- A stream of messages. Definition messages describe the layout of a kind of record, and data messages carry the values, such as one record per second with time, position and heart rate.
- A checksum (CRC) at the very end, covering the file's contents.
Summary messages, which are the lap, session and activity messages, are normally written at the end, when you press save. They hold the totals that platforms show: start time, duration, distance and averages.
What an interrupted save does
The device writes records while you move, so the body of the file is mostly there even if something goes wrong. If the battery dies, the device crashes or you unplug it during a sync, three things can be missing at once:
- The summary messages, because they were never written.
- A correct data size in the header.
- The final checksum.
A platform that validates the file sees a size or checksum that does not match, or no session, and rejects it. The recorded data may still be sitting in the file.
What can and cannot be recovered
| Recoverable | Not recoverable |
|---|---|
| Every record written before the point of damage | Anything after the first unreadable record |
| Totals, rebuilt from those records | Data the device never wrote |
| A valid header size and checksum | The original summary values, if they were lost |
If the sport was stored only in the lost summary, the tool cannot know it, so you choose it.
Trying the repair tool
- Get the original file from the device or platform. See how to export original activity files.
- Open the FIT repair tool and add the file. Everything runs in your browser, files are never uploaded and no account is needed.
- The tool finds the header and reads records until the first unreadable one. It keeps everything before that.
- It rebuilds the missing lap, session and activity messages from the recovered records, using start time, elapsed time, distance, and average and maximum heart rate where available.
- It writes a correct header size and checksum. Download the result.
If the activity was split in two by the failure, you can then combine the parts.
Repair output passes an independent FIT decoder's strict validation. We have not tested uploads to Garmin Connect or Strava, so a platform could still decline a file for its own reasons.
Reducing the risk
- Start long activities with a full battery, and save or end the activity before the battery gets very low.
- Do not unplug a device while it is syncing or copying files.
- Copy the files from the device to your computer before deleting anything.
Sources
- https://developer.garmin.com/fit/overview/ (general description of FIT messages and file types)
- The header, checksum and message layout described above are what this site's own FIT reader relies on. That reader is tested against real device recordings and against a separate open-source decoder.