Audio Formats Explained: MP3 vs AAC vs Ogg (Opus/Vorbis)

Blog / Web Development · March 12, 2014 · Updated June 10, 2026 · 7 min read
Audio Formats Explained: MP3 vs AAC vs Ogg (Opus/Vorbis)

MP3, AAC and Ogg are audio codecs and containers, not network protocols, so think of them as how you encode and package sound rather than how you transport it. Use MP3 when you need a file that plays literally everywhere (its core patents expired in 2017, so it is royalty-free). Use AAC when you want better quality at the same bitrate and first-class support across Apple devices, browsers and HLS streaming. Use Ogg as a free, open container, usually carrying Vorbis for files or the modern, low-latency Opus codec for real-time voice and WebRTC. All three are still current in 2026; what has changed is delivery — most audio now ships over adaptive HTTP streaming (HLS and MPEG-DASH) or WebRTC, not a single static download.

Formats vs protocols: clearing up the naming

This article was originally titled "streaming protocols," but MP3, AAC and Ogg are not protocols at all. The distinction matters when you architect an audio product:

  • A codec (coder/decoder) defines how raw audio samples are compressed and decompressed — e.g. MP3, AAC, Vorbis, Opus.
  • A container is the file wrapper that holds the encoded audio plus metadata — e.g. Ogg, MP4/M4A, WebM.
  • A protocol is how bytes travel over the network — e.g. HTTP, HLS, MPEG-DASH, RTMP, WebRTC.

So you might stream Opus audio inside an Ogg container over a WebRTC connection. Codec, container and protocol are three separate choices. For the transport/protocol side of the story, see our companion post on RTMP, MMS and the protocol layer.

How audio compression works

Every format below is lossy — it discards data the human ear is unlikely to notice (psychoacoustic compression) to shrink files dramatically. For context, here are the three broad categories of audio storage:

  • Uncompressed (PCM): WAV, AIFF. Full quality, large files (~1.4 Mb/s for CD audio). Used in production and mastering.
  • Lossless compression: FLAC, ALAC (Apple Lossless), WavPack. Roughly 50–60% of the original size with zero quality loss — ideal for archival and hi-fi.
  • Lossy compression: MP3, AAC, Ogg Vorbis/Opus. Often 10–20% of the uncompressed size. This is what you stream and distribute.

For distribution and streaming, lossy is almost always the right call. The rest of this guide focuses on the three lossy formats you will actually choose between.

MP3 — the universal baseline

MP3 (formally MPEG-1/2 Audio Layer III) is the most widely supported audio format in existence. If you need something that plays on any browser, phone, car stereo or embedded device with zero compatibility worries, MP3 is the safe default.

  • Compatibility: essentially universal.
  • Patents: the core MP3 patents expired in 2017, so it is now effectively royalty-free.
  • Quality: transparent for most listeners around 192–256 kbps VBR; 128 kbps is the common "good enough" web bitrate.
  • Encoder: LAME remains the de-facto open-source encoder.
  • Best for: podcasts, downloadable audio, legacy device support, maximum reach.

The trade-off is efficiency: at very low bitrates MP3 sounds noticeably worse than AAC or Opus.

AAC — the streaming standard

AAC (Advanced Audio Coding), standardised in MPEG-2 and MPEG-4, is the successor to MP3 and delivers better quality at the same bitrate. It is the default audio format across the Apple ecosystem (iPhone, iTunes/Apple Music) and the audio codec inside most HLS streams and MP4 video.

  • Efficiency: ~128 kbps AAC is broadly comparable to ~160–192 kbps MP3.
  • Flexibility: sample rates from 8 kHz to 96 kHz and up to 48 channels.
  • Container: typically delivered in an MP4/M4A container.

Common AAC profiles you will encounter:

Profile What it is Typical use
AAC-LC Low Complexity — the default profile Music streaming, HLS, broadcast
HE-AAC v1 Adds Spectral Band Replication (SBR) Low-bitrate radio (~48–64 kbps)
HE-AAC v2 Adds Parametric Stereo on top of SBR Very low-bitrate stereo (~16–32 kbps)
xHE-AAC Unified Speech and Audio Coding Adaptive, very wide bitrate range

Best for: music and on-demand streaming, the Apple ecosystem, and any HLS or MPEG-DASH pipeline.

Ogg (Vorbis & Opus) — the open, modern choice

Ogg is a free, open, patent-unencumbered container maintained by the Xiph.Org Foundation. By itself Ogg stores nothing — it carries a codec:

  • Vorbis is the older lossy codec for Ogg files, historically competitive with MP3/AAC and royalty-free. Common in games and on Wikimedia/Wikipedia.
  • Opus is the modern codec you should reach for today. It is a low-latency, royalty-free codec that outperforms MP3, AAC and Vorbis across nearly the whole bitrate range — from ~6 kbps speech to high-quality music. Crucially, Opus is the mandatory audio codec for WebRTC, making it the standard for real-time voice and video calls. Opus is also commonly carried in a WebM container, not just Ogg.

Best for: open-source and royalty-sensitive projects, game audio (Vorbis), and real-time/low-latency voice over WebRTC (Opus).

Quick comparison

Format Type Royalty status Sweet spot Best for
MP3 Codec Royalty-free (patents expired 2017) 128–256 kbps Universal compatibility, podcasts, downloads
AAC Codec (in MP4/M4A) Licensed, near-universal support 96–256 kbps Music streaming, Apple, HLS/DASH
Ogg Vorbis Codec in Ogg container Royalty-free, open 96–192 kbps Games, open-source projects
Opus Codec in Ogg/WebM container Royalty-free, open 6–256 kbps WebRTC, real-time voice, low-bitrate

How audio is actually delivered in 2026

The codec/container is only half the picture — you also choose a delivery protocol:

  • Adaptive HTTP streaming (HLS and MPEG-DASH): the dominant approach for on-demand and live audio/video. The server offers multiple bitrate renditions and the player switches automatically based on network conditions. HLS commonly carries AAC; DASH is codec-agnostic.
  • WebRTC: the standard for real-time, sub-second-latency audio such as calls and live interaction. It uses Opus as its mandatory audio codec.
  • Progressive download / static files: still perfectly valid for podcasts and short clips — just host an MP3 or AAC file behind a CDN.
  • Icecast/SHOUTcast: the classic internet-radio servers; still used for continuous live radio streams (often MP3 or AAC).

For internet radio and continuous live streams specifically, an Icecast/SHOUTcast setup with MP3 or AAC remains a proven, low-cost architecture. For interactive low-latency audio, WebRTC + Opus is the right tool.

# Transcode a master WAV into the three formats you ship most often.
# Requires a recent build of ffmpeg.

# 1) MP3 — universal compatibility (LAME VBR ~190 kbps)
ffmpeg -i master.wav -codec:a libmp3lame -q:a 2 output.mp3

# 2) AAC — streaming / Apple ecosystem (AAC-LC at 128 kbps in an M4A container)
ffmpeg -i master.wav -codec:a aac -b:a 128k output.m4a

# 3) Opus in an Ogg container — open, modern, great for voice/WebRTC sources
ffmpeg -i master.wav -codec:a libopus -b:a 96k output.opus

# Bonus: segment AAC into an HLS playlist for adaptive HTTP delivery
ffmpeg -i master.wav -codec:a aac -b:a 128k \
  -f hls -hls_time 6 -hls_playlist_type vod stream.m3u8

Choosing the right format: a simple rule of thumb

  • Need it to play everywhere with zero fuss? Ship MP3.
  • Building music/on-demand streaming or targeting Apple devices? Use AAC (over HLS/DASH).
  • Care about open formats or royalty cost, or building game audio? Use Ogg Vorbis, or Opus for anything newer.
  • Doing real-time voice/calls? Use Opus over WebRTC.

In practice, many products encode to two or three of these and let the player pick — e.g. AAC for the HLS stream plus an MP3 fallback download.

Building audio into your product

At MicroPyramid we have spent 12+ years and 50+ projects building web and cloud applications for startups and enterprises, including audio and media features — from internet radio and podcast platforms to real-time voice. If you are planning an audio-heavy product and want help choosing the right codec, container and delivery pipeline, our web development services team can design and build it end to end. For the transport-protocol side of streaming, our companion post on RTMP, MMS and streaming protocols covers the network layer.

Frequently asked questions

Are MP3, AAC and Ogg protocols?

No. They are audio codecs and containers — they define how sound is encoded and packaged, not how it travels over a network. Protocols such as HTTP, HLS, MPEG-DASH and WebRTC handle the transport. You can, for example, stream Opus audio in an Ogg container over a WebRTC connection.

Is MP3 still relevant in 2026?

Yes. MP3's core patents expired in 2017, making it royalty-free, and it has the broadest device support of any audio format. It is the safe default for podcasts, downloads and maximum compatibility, even if AAC and Opus are more efficient at low bitrates.

Should I use AAC or Opus for streaming?

Use AAC for on-demand and music streaming, especially over HLS or in the Apple ecosystem, where it has the widest support. Use Opus for real-time, low-latency audio such as voice and video calls — it is the mandatory codec for WebRTC and is more efficient at very low bitrates.

What is the difference between Ogg, Vorbis and Opus?

Ogg is the container (the file wrapper). Vorbis and Opus are codecs that can live inside it. Vorbis is the older, royalty-free codec common in games; Opus is the modern, low-latency codec that beats MP3, AAC and Vorbis across most bitrates and powers WebRTC.

How do I convert between these formats?

ffmpeg is the standard tool. For example, ffmpeg -i master.wav -codec:a libmp3lame -q:a 2 output.mp3 produces an MP3, and swapping the codec to aac or libopus produces AAC or Opus. Avoid re-encoding from one lossy format to another where possible — always transcode from a high-quality source to prevent stacking quality loss.

Share this article