# .opus MIME Type: audio/ogg

> Opus audio in an Ogg container. RFC 7845 says to serve .opus files as audio/ogg.

- MIME type: `audio/ogg`
- Extensions: .opus
- Also seen as: `audio/opus`
- Content-Type header: `audio/ogg`
- Compress in transit: no (already compressed)
- File signature: `4F 67 67 53` (the Ogg container signature; an OpusHead packet follows)

## Good to know

- `audio/opus` is registered too, but for Opus over RTP (RFC 7587), not for files.
- Name the codec in the `<source>` type so the browser can tell before downloading: `type="audio/ogg; codecs=opus"`.
- Opus is also the usual audio codec inside WebM — see [.weba](https://www.devkult.com/mime/weba.md).

## Server configuration

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

```
audio/ogg opus;
```

### Apache (.htaccess or server config)

```
AddType audio/ogg .opus
```

### Express

```
res.set("Content-Type", "audio/ogg");
```

### Python

```
import mimetypes

mimetypes.add_type("audio/ogg", ".opus")
```

### HTML file input

```
<input type="file" accept=".opus,audio/ogg">
```

## FAQ

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

`audio/ogg`. You may also see `audio/opus`, but `audio/ogg` is the one to send.

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

`Content-Type: audio/ogg`. It's already compressed, so servers shouldn't gzip it.

### How can I tell if a file is really a .opus?

Check its bytes rather than the extension: OPUS files start with `4F 67 67 53` (`OggS`) — the Ogg container signature; an OpusHead packet follows. On the command line, `file --mime-type name.opus` does this for you.

## Related types

- [.ogg — audio/ogg](https://www.devkult.com/mime/ogg.md)
- [.weba — audio/webm](https://www.devkult.com/mime/weba.md)
- [.m4a — audio/mp4](https://www.devkult.com/mime/m4a.md)
- [.mp3 — audio/mpeg](https://www.devkult.com/mime/mp3.md)

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