devkult_
tools30converters34
home/mime/.opus

.opus MIME type

Opus audioaudio

audio/ogg

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

MIME typeaudio/ogg
Extensions.opus
Also seen asaudio/opus
Content-Typeaudio/ogg
Compress in transit?No — already compressed
File signature4F 67 67 53 (OggS)
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.

Serve .opus files with the right type

The response header to send:

Content-Type: audio/ogg

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

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">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.opus | grep -i '^content-type:'
file --mime-type file.opus

Frequently asked questions

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

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options