What is the MIME type of .ogg files?
The MIME type (media type) for Ogg audio files with the .ogg extension is audio/ogg. Container for Vorbis or Opus audio. .ogv files are video/ogg.
Content-Type header
Content-Type: audio/ogg
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | audio/ogg ogg; |
Apache (.htaccess) | AddType audio/ogg .ogg |
IIS (web.config) | <mimeMap fileExtension=".ogg" mimeType="audio/ogg" /> |
| Node.js / Express | res.type('ogg') or res.setHeader('Content-Type', 'audio/ogg') |
| Amazon S3 | Set Content-Type: audio/ogg on the object (metadata), or pass --content-type audio/ogg to aws s3 cp |
Should .ogg files be compressed?
No. Ogg audio files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave audio/ogg out of your compression configuration.
Why the MIME type matters
Browsers decide what to do with a response — render, run, play or download — from the Content-Type header, not the file extension. With X-Content-Type-Options: nosniff, a wrong type causes stylesheets and scripts to be blocked outright. For uploads, never trust the type sent by the client; check the file’s content (its magic bytes) on the server.
Frequently asked questions
What is the MIME type for .ogg?
audio/ogg.How do I set the Content-Type for .ogg in Nginx?
audio/ogg ogg; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.