Free GPX test files and sample generator

The XML format GPS devices and fitness apps use for tracks, routes and waypoints. Generate valid .gpx sample files to test route importers, mapping tools and activity uploads.

Generate a .gpx file →

What is a .gpx file?

GPX: GPS Exchange Format. GPX is the XML format GPS devices, watches and fitness apps use to hand over their data. It distinguishes three things a mapping tool must handle differently: a track is where you actually went, recorded as timestamped fixes; a route is a plan of turns yet to be taken; and waypoints are individual marked places. Testing all three matters, because importers frequently support one and quietly ignore the others.

Why generate a test GPX file?

What you can put inside a .gpx file

You get 3 content options for GPX, so the file holds something meaningful rather than random padding: Recorded track, Waypoints, Planned route. For GPX these are alternatives, so choose the one that matches what you need to test.

How a .gpx file is identified

A .gpx file has no signature at the start. A text format has no identifying leading bytes, so the extension and the reported media type are the only claims about it until a parser actually reads it, which is why validating uploads by extension alone is unsafe.

How the size lands on the exact byte

XML permits whitespace after the root element, so the padding goes there. The document still parses, and the tree is unchanged.

Negative testing with broken GPX files

Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation, and for this format's encodings, UTF-16 and BOM test files.

Sample GPX content

<gpx version="1.1" creator="Software Test Data">
  <trk><name>Test Track</name><trkseg>
    <trkpt lat="40.712776" lon="-74.005974"><ele>10.0</ele></trkpt>
  </trkseg></trk>
</gpx>

This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.

How to open and verify the file

Open it in Google Earth, GPX Studio, QGIS or any GPS tool, or validate the XML with `xmllint --noout file.gpx`. Coordinates in generated files trace a loop around lower Manhattan, so a track draws as a recognisable path rather than a straight line.

Media type application/gpx+xml · extension .gpx · category Data

Generate a .gpx file → · questions about sizes, privacy or cost are answered on the site FAQ.

Frequently asked questions about GPX files

What identifies a .gpx file?

Nothing at the start of the file does. A text format has no identifying leading bytes, so the extension and the reported media type are the only claims about it until a parser actually reads it, which is why validating uploads by extension alone is unsafe.

How can a .gpx file be an exact number of bytes?

XML permits whitespace after the root element, so the padding goes there. The document still parses, and the tree is unchanged.

What can go inside the GPX file?

There are 3 content options for .gpx: Recorded track, Waypoints, Planned route. For GPX these are alternatives, so pick the one matching what you need to test.

Can I download several broken GPX files at once?

Yes, select more than one File Condition and you get one ZIP containing a .gpx per condition, each named after its condition.

Can the GPX file use UTF-16 or a byte-order mark?

Yes. .gpx is a text format, so it can be generated as UTF-8, UTF-8 with a byte-order mark, UTF-16 LE or UTF-16 BE. The body is shortened before re-encoding so the finished file still lands on the exact size you asked for. Note that a UTF-16 file always has an even byte count.

How do I open or verify the GPX file?

Open it in Google Earth, GPX Studio, QGIS or any GPS tool, or validate the XML with xmllint --noout file.gpx. Coordinates in generated files trace a loop around lower Manhattan, so a track draws as a recognisable path rather than a straight line.

Related Data formats

CSV · JSON · XLSX · XML · SQL · TSV · YAML · JSONL

Browse all file formats →