# .map MIME Type: application/json

> Source maps that map minified code back to its original source in browser devtools.

- MIME type: `application/json`
- Extensions: .map
- Content-Type header: `application/json`
- Compress in transit: yes

## Good to know

- Browsers fetch `.map` files only when devtools are open, using the `//# sourceMappingURL=` comment or the `SourceMap` response header.
- Publishing source maps exposes your original source; restrict them or upload them only to your error tracker if that matters.

## Server configuration

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

```
application/json map;
```

### Apache (.htaccess or server config)

```
AddType application/json .map
```

### Express

```
res.set("Content-Type", "application/json");
```

### Python

```
import mimetypes

mimetypes.add_type("application/json", ".map")
```

### HTML file input

```
<input type="file" accept=".map,application/json">
```

## FAQ

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

`application/json`.

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

`Content-Type: application/json`. It compresses well, so let the server apply gzip or Brotli.

## Related types

- [.js — text/javascript](https://www.devkult.com/mime/js.md)
- [.css — text/css](https://www.devkult.com/mime/css.md)
- [.json — application/json](https://www.devkult.com/mime/json.md)

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