# .json MIME Type: application/json

> JSON data. UTF-8 by definition, so the type takes no charset parameter.

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

## Good to know

- `text/json` and `text/x-json` are non-standard; some old clients send them, but servers should respond with `application/json`.
- Express needs `app.use(express.json())` to parse request bodies, and only parses requests whose Content-Type matches.
- Formats built on JSON use the `+json` suffix: `application/ld+json`, `application/problem+json`, `application/manifest+json`.

## Server configuration

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

```
application/json json;
```

### Apache (.htaccess or server config)

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

### Express

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

### Python

```
import mimetypes

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

### HTML file input

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

## FAQ

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

`application/json`.

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

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

## Related types

- [.jsonld — application/ld+json](https://www.devkult.com/mime/jsonld.md)
- [.webmanifest — application/manifest+json](https://www.devkult.com/mime/webmanifest.md)
- [.js — text/javascript](https://www.devkult.com/mime/js.md)
- [.xml — application/xml](https://www.devkult.com/mime/xml.md)

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