OGG MIME Type – Free, Online, Private
audio/ogg is the type for an Ogg audio file, commonly Opus or Vorbis. video/ogg is a different type.
What .ogg is
Ogg is a page-oriented container. Pages start with the capture pattern OggS. The codecs inside an audio file are usually Opus or Vorbis. Theora video in Ogg uses video/ogg, and a file you cannot classify uses application/ogg. RFC 5334 says to use the specific audio or video type when you know the content. A .ogg file that is audio should be audio/ogg. The codecs parameter, as in audio/ogg; codecs=opus, tells a client whether it can decode the stream without reading the identification header. Opus identification starts with OpusHead, Vorbis with a packet that begins with 01 and vorbis.
IANA registers audio/ogg in RFC 5334. video/ogg and application/ogg are different types for other Ogg contents. The media type is audio/ogg. Extensions that use it on this page: .ogg. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.
What sends audio/ogg
What sends audio/ogg: Send audio/ogg for Vorbis or Opus in Ogg when the page uses an audio element. Opus in Ogg is a common choice for voice. Add codecs when you know the codec, because a client can skip a file it cannot play. Serve Accept-Ranges: bytes if you want seeking. Ogg pages make mid-file seeking possible only if the player can find a page and the pre-skip and granule position. A server does not have to understand that. It has to return the byte range with the same Content-Type. The file on disk is still .ogg. Once the response exists, a client trusts audio/ogg, not the filename. If you only need Opus and you control the client, Ogg is fine and so is WebM. Pick one, document the type, and do not switch containers without switching the header. A service worker that caches under the URL and ignores Content-Type will replay the wrong container after a migration.
Content-Type for .ogg
Send audio/ogg and do not add a charset parameter. The body is binary. A charset tells a text decoder to reinterpret bytes that are not text, which corrupts a download and does not help a browser sniff the format.
Content-TypeContent-Type: audio/ogg
nginx, Apache, and Express
These snippets map .ogg to audio/ogg. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .ogg so a stale mime database in the framework cannot disagree with the type on this page.
nginx# /etc/nginx/mime.types, inside the types { } block
audio/ogg ogg;
ApacheAddType audio/ogg .ogg
Expressimport express from "express";
const app = express();
app.use(express.static("public", {
setHeaders(res, filePath) {
if (filePath.endsWith(".ogg")) {
res.setHeader("Content-Type", "audio/ogg");
}
},
}));
Pitfalls for audio/ogg
Pitfalls that show up for audio/ogg, and not for a neighboring type with a similar extension: Sending video/ogg for an audio-only file, or audio/ogg for Theora, makes the media element reject the resource. Look at the identification header. Another trap is application/ogg as a lazy default. It is legal and less useful. A third is an Ogg file that chains two logical bitstreams. Some players stop at the end of the first chain. A fourth is confusing Ogg Opus with WebM Opus. WebM is video/webm or audio/webm, a Matroska subset, and it does not start with OggS.
- .oga is the audio-only extension from the RFC. If you accept it, map it to audio/ogg as well.
- .ogv is video and should be video/ogg. Do not point it at this page's type.
- The codecs parameter uses names from the RFC, such as opus, vorbis, and theora. Invented names do not help.
- Do not charset an Ogg body. The pages are binary.
Frequently asked questions
When do I use audio/ogg versus video/ogg?
audio/ogg for an audio-only Ogg file. video/ogg when the file contains video, such as Theora. application/ogg is the generic fallback.
What is the signature?
The four bytes OggS at the start of each page, including the first.
Should I send a codecs parameter?
Yes when you know it. audio/ogg; codecs=opus lets the client reject the file without parsing it.
Is Ogg the same as WebM?
No. WebM is a Matroska container. It does not start with OggS and it does not use audio/ogg.