Blog / Explainers

Every Audio Format and Codec Explained: WAV, FLAC, MP3, AAC, Opus and More

Uncompressed, lossless and lossy audio, M4A, sample rate, bit depth, Bluetooth codecs and loudness, explained in plain language for creators.

PexBell8 min read
On this page
  1. Quick answer: which format for which job?
  2. The big idea: samples, PCM and three families
  3. Uncompressed: WAV and AIFF
  4. Lossless: FLAC and ALAC
  5. Lossy: MP3, AAC, Opus, Vorbis and WMA
  6. M4A and other containers
  7. Settings inside the file
  8. Bluetooth audio
  9. Platforms and loudness
  10. Common problems
  11. Five mistakes to avoid

Why does one audio file sound perfect, another thin and muddy, and a third refuse to play at all? It usually comes down to three things: the format, the codec and the settings inside the file.

This guide covers every audio format and codec you’ll meet as a creator. Facts were checked in October 2026 against official documentation where it exists (YouTube, Spotify, Apple, Xiph and the Opus project), with Wikipedia for history and specs. Where a platform doesn’t publish an official number, I say so.

Quick answer: which format for which job?

Job Use
Recording and editing WAV (24-bit, 48 kHz)
Archiving WAV or FLAC
Lossless in the Apple ecosystem ALAC
Audio for YouTube videos AAC-LC (or Opus)
Podcasts AAC or MP3
Calls and apps Opus

The big idea: samples, PCM and three families

Sound is a wave. To store it, a computer measures that wave thousands of times a second. Each measurement is a sample. The sample rate is how many measurements per second, and the bit depth is how precise each one is.

Stored as they are, samples are called PCM (pulse-code modulation): uncompressed digital audio. Every format below is a way of storing PCM, or shrinking it.

As with video, the extension names the container, not the codec. A .wav usually holds PCM but can hold MP3, and an .m4a can hold lossy AAC or lossless ALAC.

Every format belongs to one of three families:

Family What it does Examples
Uncompressed Stores every sample WAV, AIFF
Lossless Shrinks the file, decodes to an identical copy FLAC, ALAC, WMA Lossless
Lossy Shrinks much more by discarding detail you’re less likely to hear MP3, AAC, Opus, Vorbis, WMA

The reference point is the audio CD. Its Red Book standard (Sony and Philips, 1980) is two channels of 16-bit PCM at 44.1 kHz. That’s what “CD quality” means.

Uncompressed: WAV and AIFF

WAV (IBM and Microsoft, 1991) is built on RIFF, which stores data in tagged chunks. It usually holds uncompressed linear PCM.

  • Size limit: the header stores the size in a 32-bit field, so a WAV must stay under 4 GiB, about 6.8 hours of CD-quality stereo. RF64 and Broadcast Wave extend this.
  • Tags go in an INFO chunk or extra chunks (XMP, ID3). Apps skip chunks they don’t understand, so the same file can show different details in different apps.

AIFF is Apple’s equivalent (1988). It’s about 10 MB per minute at CD quality, with .aiff or .aif files (and .aifc for the compressed variant).

Why uncompressed files are big: 44,100 samples × 16 bits × 2 channels = 1,411.2 kbps before any compression.

Use uncompressed audio while recording, editing and mastering, when nothing should degrade. Compress only at the end, when you export.

Lossless: FLAC and ALAC

A lossless codec works like a zip file built for sound. The file is smaller, and playback is bit-for-bit identical to the original.

FLAC ALAC
From Xiph.Org (v1.0, 2001) Apple (2004), open since 2011 (Apache)
Licence Open, patent-free Open
Typical size 50–70% of original About half of uncompressed (independent tests: ~40–60%)
Extras Tags, cover art, fast seeking; RFC 9639 (2024) Up to 8 channels, 32-bit, 384 kHz
Usual file .flac .m4a (MP4 container)

Which one? The sound is identical, so choose by ecosystem: ALAC plays natively on Apple hardware, while FLAC is open and widely supported in other players and stereos. You can convert between them without losing anything. Microsoft also has WMA Lossless, but new projects mostly use FLAC or ALAC.

Lossy: MP3, AAC, Opus, Vorbis and WMA

A lossy codec discards detail your hearing is less likely to notice. MP3, for example, can cut file size by roughly 75–95% compared with CD audio.

Codec Background Good to know
MP3 MPEG Layer III, largely by Fraunhofer 32–320 kbps; patents expired (US, April 2017); plays everywhere
AAC Dolby, AT&T, Fraunhofer, Sony (1997) MP3’s successor, usually better at the same bitrate; AAC-LC is the common profile, HE-AAC for low bitrates
Opus Xiph, IETF RFC 6716 (2012) Open, royalty-free; 6–510 kbps; low latency; used in WhatsApp and Discord
Vorbis Xiph (2000), .ogg Xiph itself recommends Opus instead since 2013
WMA Microsoft (1999) Proprietary family; mostly older files

A rough MP3 bitrate guide (from Wikipedia): 32 kbps is acceptable only for speech, 64 kbps is generally recommended for speech, 128–160 kbps is mid-range, 256 kbps is a common high-quality choice, and 320 kbps is the maximum.

On licensing: listeners and publishers don’t need a licence to stream or distribute AAC audio, but makers of AAC encoders and decoders do.

Which lossy codec? MP3 works everywhere. AAC usually sounds better and is the safe choice for video and podcasts. Opus is excellent where it’s supported.

Generation loss: every re-encode of a lossy file loses a little more. Edit from lossless or uncompressed audio, and encode to lossy once, at the very end.

Coming soon: WAV vs FLAC vs MP3 vs AAC, which format to use.

M4A and other containers

.m4a is an audio-only MP4 file. It usually holds AAC, but it can hold lossless ALAC too.

So M4A isn’t a competitor to MP3. MP3 is a codec and a file type, while M4A is a container. To know whether an M4A is lossy or lossless, check the codec inside.

Other containers you’ll meet:

  • The M4 family: .m4b for audiobooks, .m4p for protected files, .m4r for ringtones. All MP4 underneath.
  • Ogg: carries Vorbis (.ogg) and Opus (.opus). Opus also travels in WebM, Matroska and MP4.
  • Matroska: .mka is audio only, .mkv video, .mks subtitles.

Metadata such as title, artist and cover art travels with the file. MP3 uses ID3 tags, FLAC has its own tags, and WAV and AIFF can carry ID3 or XMP. If tags vanish after conversion, the tool didn’t copy them.

Settings inside the file

Sample rate

Human hearing covers about 20 Hz to 20 kHz. The Nyquist theorem says the sample rate must be more than twice the highest frequency you want to capture.

  • 44.1 kHz was chosen by Sony for the CD.
  • 48 kHz is the standard in professional video, and what YouTube recommends for uploads.

My advice: pick one sample rate for the whole project and match your destination (48 kHz for video). Converting between rates is an extra step that can add problems.

Bit depth

16-bit 24-bit
Possible values 65,536 16,777,216
Dynamic range ~96 dB ~144 dB (theoretical)

Recording in 24-bit leaves headroom, so you’re less likely to clip, without adding noise at low volumes. 32-bit float (supported by WAV and AIFF) stores samples as floating-point numbers. It could theoretically reach 192 dB, though real microphones rarely exceed about 130 dB.

Bitrate, CBR, VBR and ABR

Bitrate is bits per second (1 kbps = 1,000 bits per second). For lossy codecs it’s the main quality dial.

  • CBR (constant): every moment gets the same data rate.
  • VBR (variable): complex passages get more bits, which gives a better quality-to-size ratio. Opus and Vorbis use it by default. Some old hardware can’t play VBR files.
  • ABR (average): you set a target average. File size is predictable, but quality isn’t.

Mono vs stereo

Voice is often recorded mono. Some platforms are strict, though: Apple Podcasts says its WAV and FLAC subscription audio should be stereo, so send two identical channels if you only have mono.

A safe starting point (my advice, not a rule): record WAV, 24-bit, 48 kHz, with good headroom.

Bluetooth audio

Over Bluetooth, your audio is compressed again. Music streams over the A2DP profile, where SBC is mandatory and other codecs work only when both devices support them.

Codec Who Bitrate Notes
SBC Mandatory in A2DP ~328–345 kbps (high quality) Reasonably good at medium bitrates
AAC Used by most AirPods and Beats — Apple notes Bluetooth isn’t lossless
aptX family Qualcomm 352 (aptX), 576 (HD), 279–420 (Adaptive) Still lossy
LDAC Sony 330 / 660 / 990 kbps In Android since version 8
LC3 Bluetooth SIG (LE Audio) — Royalty-free SBC successor; Android 13, Windows 11

Calls use a separate profile (HFP). My advice: never judge a mix or record important audio over Bluetooth. Use a wired connection.

Coming soon: a full guide to Bluetooth audio codecs.

Platforms and loudness

Upload specs:

Platform What they publish
YouTube (video uploads) AAC-LC or Opus at 48 kHz; 128 kbps mono, 384 kbps stereo, 512 kbps 5.1
YouTube Live AAC or MP3; stereo 44.1 kHz at 128 kbps; 5.1 only with AAC over RTMP(S)
Apple Podcasts MP3 or AAC (AAC strongly preferred, in MP4); stereo 128–256 kbps, mono 64–128 kbps
Spotify (listening tiers) About 24 / 96 / 160 / 320 kbps, plus lossless FLAC up to 24-bit 44.1 kHz
Apple Music lossless Uses much more data; above 48 kHz on iPhone needs an external DAC

Loudness is measured in LUFS (the same thing as LKFS, from ITU-R BS.1770). Published targets differ by platform:

Destination Target
Apple Podcasts About −16 LKFS (±1)
Spotify Normalises playback to −14 LUFS
EBU R128 broadcast −23 LUFS
YouTube No official numeric upload target found in its help pages

Keep true peak at or below −1 dBTP (Apple Podcasts and Spotify both ask for this).

Coming soon: what LUFS is, and loudness targets for every platform.

Two last terms:

  • “Compression” means two things in audio. Dynamic range compression changes the sound by narrowing the gap between loud and quiet parts. Data compression (what codecs do) only shrinks the file size.
  • Processing order: Apple advises setting loudness before encoding, because encoders don’t fix loudness and can clip. So edit, set loudness, then encode once.

Common problems

Problem Likely cause
Won’t play The codec, not the extension
Sounds thin or watery Lossy bitrate too low, or re-encoded
Files are huge WAV used where you don’t need it
Clips after export True peak or loudness too high

Five mistakes to avoid

  1. Judging a file by its extension.
  2. Editing from an MP3.
  3. Mixing sample rates in one project.
  4. Exporting too loud, with no true-peak headroom.
  5. Judging a mix through Bluetooth headphones.

Try it: open one of your files in the free tool MediaInfo and check its real codec, sample rate and bitrate.