# .toml MIME Type: application/toml

> Config files like Cargo.toml and pyproject.toml, registered with IANA as application/toml.

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

## Good to know

- TOML files must be UTF-8, so like JSON the type takes no charset parameter.
- The registration is recent, and most servers' default `mime.types` have no `.toml` entry — they send `text/plain` or `application/octet-stream`. Map it explicitly if a client checks the type.

## Server configuration

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

```
application/toml toml;
```

### Apache (.htaccess or server config)

```
AddType application/toml .toml
```

### Express

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

### Python

```
import mimetypes

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

### HTML file input

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

## FAQ

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

`application/toml`.

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

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

## Related types

- [.yaml — application/yaml](https://www.devkult.com/mime/yaml.md)
- [.json — application/json](https://www.devkult.com/mime/json.md)
- [.md — text/markdown](https://www.devkult.com/mime/md.md)

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