Audio and Music Guides
Digital Audio Basics: Sample Rate, Bit Depth, Bitrate, Codecs
Digital audio is sound stored as numbers, and every audio file is described by the same few of them: sample rate, bit depth, bitrate and channel count. Two more words, codec and container, say how the sound was packed and what kind of file holds it. These digital audio basics explain why two copies of one song can differ tenfold in size.
None of this is needed to press a download button. It helps when you choose between formats, wonder why a file is large, or want to know what a label such as 320 kbps really promises. Each term below comes with the figures behind CD quality, the usual reference point. For one format in depth, read what an MP3 file is.
Sample rate: how often digital audio measures the sound
A microphone turns sound into a smoothly varying electrical signal. To store it, a converter measures that signal at fixed intervals, and each measurement is called a sample. The sample rate is the number of samples taken per second. CDs use 44,100, written 44.1 kHz. Video and broadcast use 48 kHz. Studio recordings are often made at 96 kHz.
A sample rate can capture pitches up to half its own value. So 44.1 kHz reaches about 22 kHz, just past the 20 kHz upper limit of young, healthy hearing. That is why CD audio stopped there. Higher rates record sound above what people hear. They help during production and make larger files, without a proven benefit for a finished song.
Bit depth: how finely each sample is recorded
Bit depth is the number of bits used to write down each sample. With 16 bits there are 65,536 possible levels. With 24 bits there are more than 16 million. More levels mean smaller rounding errors, and those errors are heard as a faint background hiss. Each extra bit lowers the hiss by about 6 decibels.
A 16-bit recording spans about 96 dB between its loudest sound and its noise floor, more than most listening rooms can use. A 24-bit recording spans about 144 dB and is the norm in studios, where the spare range forgives imperfect level settings. Bit depth does not decide which pitches are captured. That is the job of the sample rate.
Bitrate and channels: the data used each second
Bitrate is the amount of data used for each second of sound. For uncompressed audio it is plain multiplication: 44,100 samples times 16 bits times 2 channels gives 1,411,200 bits per second, or 1,411 kbps. That is CD quality, and it fills about 10.6 megabytes a minute. Mono has one channel, stereo two and 5.1 surround six.
Compressed formats turn the sum around. The bitrate is chosen first, for example 128 or 256 kbps, and the encoder decides which detail fits inside that budget. This is why bitrate is the figure most often quoted for MP3 files. The MP3 bitrate guide shows what each common setting costs in megabytes and what it gives back in sound.
Codec and container: the method and the wrapper
A codec is the method used to pack and unpack the audio. PCM stores raw samples with no packing. FLAC and ALAC are lossless: they shrink the data and return every sample intact. MP3, AAC and Opus are lossy: they discard detail judged inaudible and reach far smaller sizes. The audio format comparison sets MP3, AAC, Opus, WAV and FLAC side by side, and MP3 vs FLAC takes the lossy and lossless pair on its own.
A container is the file that wraps the encoded sound. WAV usually wraps PCM, M4A usually wraps AAC, and WebM often wraps Opus. The file ending names the container, and the codec inside can vary. YouTube stores a video's sound as AAC or Opus, so a YouTube to MP3 converter has to re-encode that stream.
Questions and answers
Is bit rate the same as bit depth?
No. Bit depth is the number of bits in each sample and sets how precise each measurement is. Bitrate is the number of bits used per second for the whole stream. In uncompressed audio, bitrate equals sample rate times bit depth times channels. Lossy files such as MP3 have a bitrate but no fixed bit depth.
Should I use 44.1 kHz or 48 kHz?
Match the purpose. Use 44.1 kHz for music meant for CD or general listening, and 48 kHz for sound that belongs to video, where it is the standard. Neither sounds better than the other. If a file already has one of these rates, leave it, because converting between them gains nothing.
What is the difference between a codec and a container?
A codec is the method that encodes and decodes the sound, such as AAC, Opus or FLAC. A container is the file format that holds the encoded stream along with tags and sometimes video, such as MP4, WebM or Ogg. One container can hold different codecs, so the file ending alone does not say which was used.
Does a higher sample rate always sound better?
No. A rate of 44.1 or 48 kHz already covers the full range of human hearing. Higher rates capture ultrasonic content and are useful during recording and editing, but listening tests have not shown a dependable audible gain for finished music. Raising the rate of an existing file adds no information.
What do the numbers for CD quality mean?
CD quality is 44.1 kHz, 16-bit, stereo. That is 44,100 samples per second, each written with 16 bits, on two channels. Multiplied together it comes to 1,411 kbps, roughly 10.6 MB for every minute, with no compression applied.
Is mono worse than stereo?
Not for everything. Mono carries one channel, which is enough for speech, podcasts and lectures, and a mono file can spend its whole bitrate on that single channel. Music mixed in stereo loses its left-to-right spread when folded down to mono, so keep stereo for songs.
What is lossless audio?
Lossless audio is compressed without discarding anything, so playback returns exactly the samples that went in. FLAC and ALAC work this way and typically reduce a WAV file to about 50 to 70 percent of its size. A lossless file made from a lossy source is not improved. It preserves the losses.
What is PCM?
PCM, pulse-code modulation, is the plain uncompressed form of digital audio: a list of sample values with nothing removed and nothing packed. WAV and AIFF files normally contain PCM, and so do audio CDs. Every other codec starts from PCM and returns to it for playback.
Updated: