DevToolsmith

OGG MIME Type

audio/ogg is the MIME type for Ogg audio (Vorbis or Opus). Here is the Content-Type header to send, the file signature, and how to configure servers and code.

MIME type
audio/ogg
Extensions
.ogg, .oga, .opus
Content-Type header
audio/ogg
Registered
Yes, with IANA
Compress with gzip
No, it is already compressed
Category
Audio

About Ogg audio files

Ogg is a container; the audio inside is Vorbis or, more often today, Opus, which sounds better than MP3 at lower bitrates. Opus files usually have the .opus extension and the same type; add a codecs parameter when it matters: audio/ogg; codecs=opus. Ogg video (.ogv) uses video/ogg.

File signature

OGG files start with 4F 67 67 53 ("OggS"). The extension and the type a browser reports for an upload both come from the file name, so check these bytes on the server before trusting a file.

Serve .ogg with the right Content-Type

Response header
Content-Type: audio/ogg
nginx (a line in the types { } block of mime.types)
audio/ogg ogg oga opus;
Apache (.htaccess or server config)
AddType audio/ogg .ogg .oga .opus
Caddy
@ogg path *.ogg *.oga *.opus
header @ogg Content-Type "audio/ogg"
Check what a server sends
curl -sI https://example.com/file.ogg | grep -i '^content-type'
# Content-Type: audio/ogg

Set the type in code

Node.js (Express)
res.set('Content-Type', 'audio/ogg');
// Or make the browser download it:
res.attachment('file.ogg');
Python
import mimetypes

mimetypes.add_type('audio/ogg', '.ogg')  # if your system doesn't know it
mimetypes.guess_type('file.ogg')[0]  # 'audio/ogg'
Go
mime.AddExtensionType(".ogg", "audio/ogg")
w.Header().Set("Content-Type", "audio/ogg")

Accept .ogg uploads

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

The accept attribute only filters the file picker; users can still choose another file. Listing the extension as well as the type matters, because operating systems don’t always report the type you expect.

Related types

  • .mp3 (audio/mpeg): MP3 audio
  • .webm (video/webm): WebM video
  • .flac (audio/flac): FLAC audio

More audio

.wav , .m4a , .aac . Look up any extension or type with the MIME type lookup.

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What is the MIME type for .ogg files?

audio/ogg. The full header is "Content-Type: audio/ogg".

Why does my server send the wrong Content-Type for .ogg?

Web servers pick the type from the file extension using a table (mime.types in nginx and Apache). If .ogg is missing from that table, they send a default such as application/octet-stream or text/plain. Add the mapping as shown on this page, then check the response with "curl -sI".

How can I check that a file really is OGG?

Look at the first bytes rather than the extension or the type the browser reports, which both come from the file name. OGG files start with 4F 67 67 53 ("OggS"). The MIME type lookup on this site reads them for you when you drop a file on it.