Audio Codecs Explained: MP3, AAC, Opus, FLAC & More
Audio codecs explained in plain language — how MP3, AAC, Opus, FLAC, and Vorbis actually encode sound, where each one shines, and which ones you'll run into on YouTube.

<!-- Meta Title: Audio Codecs Explained: MP3, AAC, Opus & More --> <!-- Meta Description: Audio codecs explained — how MP3, AAC, Opus, FLAC, and Vorbis encode sound differently, and which codec matters for your specific workflow. --> <!-- Suggested URL slug: /blogs/audio-codecs-explained/ -->
# Audio Codecs Explained: What's Actually Happening to Your Sound
A codec is just a piece of math that decides how your audio gets stored. That's it. But the specific math matters enormously, because it determines your file size, your playback compatibility, and — most critically — whether that snare hit still cracks or turns to mush. With so many audio codecs explained across forums and YouTube comments, most breakdowns fall into two camps: either a wall of ISO specification numbers or "just use MP3 lol." Neither helps you make an informed decision about what's actually happening to your audio at the encoding stage.
So let's fix that. Here's what each major codec does, why it exists, and when it's the right call.
What a Codec Actually Is (and Isn't)
People conflate "codec" with "file format" constantly. They're not the same thing. A codec (coder-decoder) is the algorithm that compresses and decompresses audio data. A container format — like .mp4, .mkv, .ogg, or .webm — is the wrapper that holds the compressed data along with metadata, chapter markers, and sometimes video streams.
MP3 is both a codec and effectively its own container (.mp3 files). But AAC audio can live inside .m4a, .mp4, .mkv, or .3gp containers. Opus can sit inside .ogg, .webm, or .opus files. FLAC is typically its own container but can also be muxed into .mkv or .ogg. The codec handles the sound. The container handles the packaging.
Why does this distinction matter? Because when you download audio from YouTube, the Opus-encoded stream arrives in a WebM container. If you convert that to WAV using YTtoWAV , you're decoding the Opus audio and storing the raw PCM result in a WAV container — no re-encoding, no additional quality loss from the conversion itself.
MP3: The Codec That Started Everything
MP3 (MPEG-1 Audio Layer III) was standardized in 1993 and single-handedly created the digital music distribution era. Fraunhofer Institute's psychoacoustic model was the key insight: identify frequencies your ears can't perceive — masked tones, sub-threshold signals, content above your hearing ceiling — and throw them away. A 4-minute song drops from roughly 40 MB (as WAV) to about 3.5 MB at 128 kbps. The remaining 90% of the data? Gone. Permanently.
MP3's encoder processes audio in frames of 1,152 samples. At 44.1 kHz, each frame covers about 26 milliseconds. The psychoacoustic model evaluates each frame independently, which is part of why MP3 struggles at low bitrates — it can't "borrow" quality budget from simpler passages to spend on complex ones (unless you use VBR encoding, which helps significantly). At 320 kbps, MP3 is genuinely transparent for most listeners on consumer gear. Below 192 kbps, trained ears start catching artifacts: pre-echo on transients, metallic-sounding cymbals, narrowed stereo width.
The codec's real superpower in 2026 isn't quality. It's universality. Every device, every OS, every car stereo, every cheap Bluetooth speaker on earth decodes MP3. That kind of compatibility took 30 years to build and isn't going anywhere soon. If you need a lossy file that plays literally everywhere, MP3 at 256–320 kbps is still hard to argue with.
AAC: MP3's Designed Successor
Advanced Audio Coding was built by a consortium that included Dolby, Sony, AT&T Bell Labs, and — notably — Fraunhofer, the same institute behind MP3. It was standardized in 1997 as MPEG-2 Part 7, then refined as MPEG-4 Part 3. The explicit goal was to fix MP3's known weaknesses: poor low-bitrate performance, inefficient stereo coding, and limited frequency resolution.
AAC uses larger transform windows (up to 2,048 samples vs. MP3's 1,152), allowing the encoder to make smarter allocation decisions. It also employs Temporal Noise Shaping, which shapes quantization noise to follow the audio signal's energy contour — a trick MP3 simply doesn't have. The result: at 128 kbps, AAC-LC consistently outperforms MP3 in blind listening tests. At 96 kbps, the gap widens further. Apple adopted AAC for iTunes in 2003, and it's been the default codec for iPhone recordings, Apple Music, and Apple Podcasts ever since.
AAC has profiles that matter. AAC-LC (Low Complexity) is what you encounter 95% of the time. HE-AAC v1 adds Spectral Band Replication for decent quality at 48–64 kbps — great for talk radio and low-bandwidth streams. HE-AAC v2 layers on Parametric Stereo for even lower bitrates. xHE-AAC, the newest variant, is what modern streaming services are eyeing for adaptive bitrate switching. Each profile targets a different use case, and they're not interchangeable.
Audio Codecs Explained: Opus, the Modern Standard
Opus is what happens when the speech codec world and the music codec world stop competing and collaborate. Standardized by the IETF as RFC 6716 in 2012, Opus merges Skype's SILK speech engine with Xiph.Org's CELT music engine into a single codec that dynamically switches between them. A YouTube video where someone talks for two minutes, plays a guitar riff, then talks again? Opus handles all three segments optimally without you doing anything.
The performance numbers are genuinely impressive. Independent listening tests at HydrogenAudio show Opus reaching transparency around 96 kbps for stereo music — a bitrate where MP3 sounds noticeably degraded and AAC is still showing artifacts. Its algorithmic latency can be as low as 5 ms (compare MP3's ~100 ms and AAC-LC's ~90 ms), which is why it dominates VoIP, WebRTC, Discord, and basically every real-time audio application built this decade.
YouTube adopted Opus around 2013–2014, initially for higher-quality streams in WebM containers. By now, it's the primary audio codec for most YouTube playback. When you use YTtoWAV to convert a YouTube video, the source audio you're working with is almost certainly Opus at 128–160 kbps. Understanding that helps set realistic expectations: you're getting excellent lossy quality, but it's still lossy. Converting to WAV preserves every detail present in that Opus stream — it doesn't add information back, but it gives you an uncompressed file that won't degrade further during editing.
Opus is also royalty-free, which matters for adoption. MP3's patents expired in 2017, but AAC still carries licensing requirements from Via Licensing. Opus has none. That's a significant reason platforms, open-source projects, and game engines prefer it.
FLAC and the Lossless Codecs
FLAC (Free Lossless Audio Codec) compresses audio without removing any data. Decompress a FLAC file and you get the exact PCM stream you started with — bit-for-bit identical. It achieves this through linear prediction and Rice coding, finding mathematical patterns in the waveform data and encoding them compactly. Typical compression ratios land around 50–60% of the original size, so a 40 MB WAV becomes roughly 20–24 MB as FLAC.
Apple's equivalent is ALAC (Apple Lossless Audio Codec). Functionally identical in concept — lossless, similar compression ratios — but wrapped in Apple's ecosystem. ALAC plays natively on iPhones, iPads, and Macs. FLAC requires third-party apps on Apple devices but works natively on Android, Windows, Linux, and most modern car head units.
Other lossless options exist. WavPack offers a hybrid mode that stores a lossy file plus a correction file — play the lossy part for casual listening, combine both for bit-perfect playback. APE (Monkey's Audio) achieves slightly better compression than FLAC but at the cost of significantly higher CPU usage during decoding. For most people, FLAC is the practical choice: broad support, fast decoding, open source.
Here's the honest take on lossless for the average listener: if you're streaming through Bluetooth earbuds on a bus, you genuinely won't hear the difference between 256 kbps AAC and FLAC. The gap only becomes meaningful on revealing playback chains (open-back headphones, decent DAC, quiet room) or when you're planning to edit, process, or archive the audio. For production work, though, starting from a lossless or uncompressed source is non-negotiable.
Vorbis: The One That Almost Won
Before Opus existed, Xiph.Org's Vorbis was the leading open-source lossy codec. It competed well with MP3 and early AAC implementations, and it was the audio codec inside .ogg containers on many games, Linux distributions, and early web apps. Spotify's desktop client used Ogg Vorbis at 320 kbps for its "Very High" quality tier for years.
Vorbis hasn't been actively developed since Opus arrived, and for good reason — Opus outperforms it at every bitrate. But you'll still encounter Vorbis in older game assets, some Spotify streams, and archived audio collections. It's not bad. It's just been superseded by its own successor.
How YouTube's Audio Pipeline Actually Works
When a creator uploads a video, YouTube re-encodes the audio into multiple formats and bitrates. The highest-quality audio stream typically tops out at Opus 160 kbps inside a WebM container. Some videos also offer AAC 128 kbps inside an MP4 container as a fallback for older devices. YouTube does not store or serve WAV, FLAC, or any lossless format — bandwidth costs at that scale would be astronomical.
This means every YouTube audio conversion, regardless of what tool you use, starts from a lossy source. The best practice is to convert that Opus stream to WAV without any re-encoding of the audio data — decode the Opus to PCM, wrap it in a WAV container. That's what YTtoWAV does. You get the full fidelity of the Opus source in an uncompressed format that every DAW, editor, and audio tool on the planet can open without codec compatibility headaches.
FAQ
What's the difference between a codec and a file format?
A codec is the algorithm that compresses or decompresses audio data. A file format (container) is the wrapper that stores the compressed data. MP3 is both a codec and a format, but AAC audio can live in .m4a, .mp4, or .mkv containers, and Opus can sit in .ogg or .webm files.
Which audio codec does YouTube use?
YouTube primarily uses Opus (typically 128–160 kbps) in WebM containers for most playback. Some streams also include AAC at 128 kbps in MP4 containers as a fallback for devices that don't support Opus.
Is Opus better than MP3?
At equivalent bitrates, yes. Opus at 96 kbps generally matches or exceeds MP3 at 128–160 kbps in blind listening tests. Opus also has dramatically lower latency (5 ms vs. ~100 ms) and handles both speech and music efficiently, while MP3 was designed primarily for music.
Can I convert lossy audio to lossless without losing quality?
You can convert a lossy file (like Opus or MP3) to a lossless container (like WAV or FLAC), and doing so preserves every bit of audio present in the lossy source. However, it won't restore the data that was discarded during lossy encoding. The benefit is that the converted file won't degrade further during editing or re-encoding.