# .gpx MIME Type: application/gpx+xml

> GPS tracks, routes and waypoints exported from GPS devices, fitness apps and mapping tools.

- MIME type: `application/gpx+xml`
- Extensions: .gpx
- Content-Type header: `application/gpx+xml; charset=utf-8`
- Compress in transit: yes

## Good to know

- `application/gpx+xml` isn't registered with IANA, but it's what apps use and what Apache's stock config maps `.gpx` to.
- GPX stores latitude and longitude as named attributes (`<trkpt lat="…" lon="…">`), so unlike GeoJSON there's no ordering trap.

## Server configuration

### nginx (inside the types block in mime.types)

```
application/gpx+xml gpx;
```

### Apache (.htaccess or server config)

```
AddType application/gpx+xml .gpx
```

### Express

```
res.set("Content-Type", "application/gpx+xml; charset=utf-8");
```

### Python

```
import mimetypes

mimetypes.add_type("application/gpx+xml", ".gpx")
```

### HTML file input

```
<input type="file" accept=".gpx,application/gpx+xml">
```

## FAQ

### What is the MIME type for .gpx files?

`application/gpx+xml`.

### What Content-Type header should a .gpx file be served with?

`Content-Type: application/gpx+xml; charset=utf-8`. As a text format, include the charset so browsers don't guess the encoding. It compresses well, so let the server apply gzip or Brotli.

## Related types

- [.geojson — application/geo+json](https://www.devkult.com/mime/geojson.md)
- [.kml — application/vnd.google-earth.kml+xml](https://www.devkult.com/mime/kml.md)
- [.xml — application/xml](https://www.devkult.com/mime/xml.md)

Open the interactive page: https://www.devkult.com/mime/gpx