About This Tool
GPX Repair is a free browser tool that fixes damaged GPX files. A GPX file is plain XML text, and a single fault — a recording cut off when the battery died, an unescaped & in a waypoint name, a lost closing tag — is enough to make every app refuse to open it, even though almost all of the data is still there. This tool reads the file with a forgiving parser that keeps going where a normal one stops, repairs what it finds, and writes out a clean GPX file holding everything that could be recovered. It lists each fix, checks the file with the GPX validator before and after, and draws the recovered track on a map. Nothing is uploaded; the file is read and repaired entirely in your browser.
How to Use It
- Load the file. Drag and drop the damaged .gpx file onto the upload area, or click to browse. The repair runs straight away.
- Read the two verdicts. Before shows how a strict reader sees your file: unreadable, invalid, or valid. After shows the same check on the repaired file.
- Check what was fixed. Every change is listed in plain words, grouped by the file itself, the GPX header, structure, points, and timestamps.
- Check what was recovered. The table counts the tracks, points, and waypoints in the repaired file and how many points had to be removed. The map shows where they are.
- Adjust the options if needed. You can choose how timestamps that run backward are handled, and whether points at 0°, 0° and empty tracks are removed. The result updates at once.
- Download. Download Repaired GPX saves a copy named
yourfile_repaired.gpx. Your original file is never modified.
What It Fixes
| Problem | What the repair does |
|---|---|
| File cut off mid-write | Closes the open track, segment, and point. A number or timestamp cut in half is removed; the point it belonged to is kept if its position is complete |
Unescaped & or < in text | Escapes them so the text reads the same and the file parses |
| Missing or stray closing tags | Closes elements where they must have ended and drops closing tags that match nothing |
| Damaged tags and attributes | Removes a tag that cannot be read, quotes unquoted attribute values, drops duplicate attributes |
| Control characters and damaged bytes | Removes characters XML does not allow, including bytes that do not fit the file’s encoding |
| Namespace prefix used but not declared | Declares it. Common Garmin prefixes such as gpxtpx get their real namespace |
| Missing root element or attributes | Adds the <gpx> element, version, namespace, and creator |
| Two GPX documents in one file | Merges them into one |
| Points with no usable position | Removes points whose latitude or longitude is missing, not a number, or out of range. Decimal commas are changed to points |
| Points at 0°, 0° | Removes them (optional). A fix at exactly 0, 0 is almost always a GPS dropout |
| Bad elevation or timestamp values | Rewrites timestamps such as 2026-07-07 08:15:00 in the standard form; removes values that cannot be read |
| Timestamps that run backward | Sorts the points by time, or removes the stray timestamps (see below) |
| Elements in the wrong order or place | Puts waypoints, routes, and tracks, and the fields inside each point, in the order the GPX schema requires; wraps loose points in a track segment |
| Empty tracks, segments, and routes | Removes them (optional) |
The repair never invents data. A value that cannot be read is removed, not guessed, and the report tells you how many points were taken out.
Frequently Asked Questions
My recording stopped when the battery died. Can the track be recovered?
Almost always. A logger writes points to the file as it goes, so everything up to the moment it stopped is there; what is missing is the end of the last point and the closing tags. The repair closes the file properly and keeps every complete point. Points the device had not yet written to storage cannot be recovered by any tool.
How are timestamps that run backward handled?
With Automatic, the repair looks at how much of a track segment is out of order. A few stray points — a clock glitch — keep their position and lose their timestamp. When a larger part is out of order, usually because recordings were joined in the wrong sequence, the points are sorted by time. You can force either behavior, or leave the timestamps alone, in the options.
Does the repaired file keep my extensions and sensor data?
Yes. Heart rate, cadence, temperature, and any other vendor extensions are carried over as they are, along with comments in the file. The repaired file is rewritten with consistent indentation and saved as UTF-8, so it will not match the original line for line.
What does it do with a file that is already fine?
Nothing. If the file is well-formed and has no fixable problem, the tool says so and offers no download. Warnings that have no automatic fix, such as a track without a name, are listed for you to deal with in an editor.
What can it not fix?
It cannot restore data that is not in the file, and it does not correct positions: a track with GPS drift or spikes is valid GPX and comes through unchanged. It works on GPX only; binary formats such as FIT, and KML files, are not GPX. For KML, use the KML to GPX converter.
How is this different from the GPX Validator?
The GPX Validator tells you what is wrong, point by point, and needs a file it can at least open. GPX Repair fixes the problems, and it works on files that are too damaged to open at all. A good routine is to repair here, then read the validator’s report on anything that is left.
Is my file uploaded anywhere?
No. The file is read and repaired by JavaScript in your browser, and the new GPX is generated on your device. The map loads background tiles from OpenStreetMap, but your track is never sent anywhere.
What are the file limits?
Files up to 25 MB. The file should have a .gpx extension; .xml and .txt are accepted too, since damaged files are sometimes renamed.
Related Tools
Check the repaired file in the GPX Validator, then open it in the GPX Analyzer to see its distance, elevation, and speed. If the recovered track has junk at the start or end, trim it in the GPX Editor.
Learn More
Request a Feature
Have a damaged file this tool could not fix, or an idea that would make it better? Post it on the feature request board and vote on what gets built next.