First, confirm the file is really GPX
A filename ending in
.gpx
does not guarantee the contents are valid. A failed download might save a login page or an error message under the wrong extension. Find the file in your storage and check its size. If it is empty or extremely short, download it again from the source.
Open the file in a plain text editor. A normal GPX usually begins with an XML declaration or a
<gpx>
root element and contains geographic content such as
<trk>
,
<rte>
or
<wpt>
. If you see an HTML page or unrelated data, request a fresh export rather than attempting a manual XML repair.

Common reasons a GPX file fails
- Incomplete download: the file stops abruptly or has missing closing tags.
-
Broken XML:
an unescaped
&, incorrectly nested tag or missing quote makes the document invalid. - Wrong document structure: elements are outside the GPX root or required attributes are missing.
- No useful geographic data: the file parses, but it contains no track or route points to draw.
- Unsupported fields: an app cannot understand extensions that another device created.
- Incorrect coordinates: points may be valid XML but appear far from the intended place.
Each situation needs a different response. Use the GPX Viewer as a first test; its error feedback can help distinguish parsing issues from an empty route.
Step-by-step troubleshooting workflow
- Keep the original. Copy it before making any changes.
- Try downloading or exporting again. This fixes many partial-file problems.
-
Open it as text.
Check whether it is XML with one
<gpx>root element. -
Check the structure.
In GPX 1.1, tracks use
<trk>and<trkseg>with<trkpt>points; routes use<rte>with<rtept>points. -
Look for invalid characters.
Literal ampersands in names or descriptions should be escaped as
&in XML. - Validate against GPX expectations using a reliable XML or GPX validator when possible.
- Reopen it on a map. Check location, gaps and point count after every repair.
The official GPX 1.1 schema documentation is a useful reference if you are checking XML elements. For a beginner explanation, read what is a GPX file? .
Fix a track that opens but shows no line
A valid GPX may include only waypoints. Those appear as individual locations, not a continuous route. Another possibility is a track whose segment has no points or only one point. A viewer cannot draw a meaningful line from absent geometry.
Check if a route, track or waypoint set is present before concluding that the file is corrupted. The guide on opening GPX files explains how GPX content can appear differently between applications.
Fix a file that shows a strange straight line
A GPS spike can happen when one coordinate is wrong. If the rest of the track is valid, the GPX Track Editor can help remove or correct individual outlier points. Do not move large groups of points unless you know their intended locations.
If a line connects two distant activities, the issue may be an incorrectly merged segment rather than a bad coordinate. See how to merge multiple GPX files for why segment boundaries matter.
When repair is not possible
If a device never recorded a portion of the journey, there may be no original coordinates to recover. You can reconstruct an approximate line from other evidence, but it must not be presented as a faithful GPS recording. Likewise, missing timestamps or altitude cannot be recovered reliably from an empty field without additional source data.
Example: an XML ampersand error
Suppose a GPX description contains a name like
Forest & Lake
as raw XML text. In XML, an ampersand begins an entity reference. To represent the literal character, it should be
Forest & Lake
in the source. A single unescaped character may cause an otherwise useful GPX to fail parsing.
However, editing raw XML can create new errors. If you use a text editor, change only the problematic text and keep a backup. If a file comes from a recording app that can export GPX again, try re-exporting first. An automated validator is often more reliable than guessing which tag needs to be added.
Data recovery versus file repair
Fixing XML syntax can make a valid set of coordinates readable again; it cannot recreate points that were never recorded. Likewise, a track that abruptly ends because a device ran out of battery is incomplete, not necessarily corrupt. Avoid filling the gap with invented points unless the output is clearly described as an approximate planned path rather than an original GPS log.
Frequently asked questions
Can changing the extension repair a GPX?
No. Renaming a file to
.gpx
cannot repair malformed XML or turn another file format into GPX.
Is a GPX file with no timestamps corrupted?
Not necessarily. Timestamps are optional in GPX. A valid route or track can consist of geographic coordinates without recorded times.