Two files both say 4 Mbps, yet one was encoded at a constant rate and the other at a variable rate. Do they take the same space? That depends on what the number means. With a constant bitrate it is the rate at every moment. With a variable bitrate it may be an average or a peak, and the file size you compute from it is an estimate.

This guide defines the modes, shows with a labeled example how an average gives the size of a variable-rate file, and explains why a peak figure gives the wrong answer.

Three ways to set a bitrate

MDN's audio guide describes two mutually exclusive ways to control quality with the bit rate. One targets an average bit rate. The other sets a constant quality and lets the bit rate vary. It also describes constant bit rate (CBR) as a close relative of the average setting (ABR).

Mode What you set What the encoder does Can you predict the size?
CBR (constant bit rate) A fixed rate Uses an actually fixed bit rate for the whole duration Yes, from the formula
ABR (average bit rate) An average rate Aims for the specified bits per second on average, letting quality fluctuate Yes, as an estimate
VBR (variable bit rate) A quality level Lets the rate rise and fall to hold that quality Only roughly, until it has been encoded

For VBR, MDN says the rate may be very low where compression is easy and higher where the sound is complex. Uncompressed PCM audio is constant by construction, because sample rate × bit depth × channels never changes. The audio file size calculator is built on that fixed rate.

CBR: the formula gives the size

When the rate is fixed, the size of the encoded stream follows from the settings:

bytes = bitrate in bit/s × seconds ÷ 8

Worked example. Example: audio set to a constant 128 kbps for 4 minutes (240 seconds).

  1. Bitrate: 128 kbps = 128,000 bit/s.
  2. Bits: 128,000 × 240 = 30,720,000 bits.
  3. Bytes: 30,720,000 ÷ 8 = 3,840,000 bytes, or 3.84 MB (decimal: 1 MB is 1,000,000 bytes).

Two caveats keep this from being the size of the whole file. The container adds overhead, which RFC 8216 includes in a segment's bit rate. And the label "CBR" does not always mean a perfectly even stream. RFC 6716, which defines the Opus codec, says the mode that MP3 and AAC call CBR is not true CBR because of a bit reservoir. Treat the formula as the number to expect and check it against the real file.

VBR: an average makes the estimate

A variable-rate file has no single rate, so the formula needs the average bitrate: total bits divided by total seconds. RFC 8216 defines the average segment bit rate in just this way, as the total size in bits divided by the duration.

Worked example. Example: a 10-minute clip, split into five 2-minute pieces. The piece rates below are invented inputs to show the arithmetic, not measurements.

Piece Bitrate Bytes in 120 seconds
1 2 Mbps 30,000,000
2 3 Mbps 45,000,000
3 4 Mbps 60,000,000
4 5 Mbps 75,000,000
5 6 Mbps 90,000,000

Total: 300,000,000 bytes. Average bitrate: 300,000,000 × 8 ÷ 600 = 4,000,000 bit/s, or 4 Mbps. Peak bitrate: 6 Mbps. Size from the average: 4,000,000 × 600 ÷ 8 = 300,000,000 bytes. Size from the peak: 6,000,000 × 600 ÷ 8 = 450,000,000 bytes, which is 50 percent too high.

The same file therefore has two honest bitrates, and only one of them predicts its size. RFC 8216 defines both: the peak segment bit rate and the average segment bit rate. Its streaming playlists must declare the peak and may declare the average. Use the average for storage and transfer totals, as in how to calculate video file size from bitrate. The peak matters for a different question, which is how much capacity the stream needs at its busiest moment.

ABR sits between the two modes. You still get one number to multiply, but it is a target the encoder works toward across the whole file, so a result slightly above or below it is possible. With a constant-quality VBR setting, nobody knows the average until the encode is finished, because it depends on how complex the content is. The video file size calculator can still work forward from a target average, and backward from a target size.

Which mode fits which job

Need Mode to consider Why
A file that must fit a known size CBR or ABR The size follows from the rate you set
Quality held steady across the whole file VBR with a constant-quality setting The rate moves to keep the quality level, so the size is a result
Voice-only audio CBR MDN says CBR is primarily used in voice-only codecs, where variation is minimal

For the Opus codec, RFC 6716 says VBR is more efficient and is the default. It lists two reasons to use CBR: a transport that supports only a fixed size for each compressed frame, and encryption of highly constrained or highly sensitive audio streams. Both are uncommon. For sizing a file to a limit, see how to choose a bitrate for a target file size.

Common mistakes

  • Using the peak bitrate for size. In the example above it overstated the size by 50 percent. Use the average.
  • Assuming a constant rate means constant quality. CBR fixes the data rate. MDN notes that it works without unworkable quality swings mainly in voice codecs, where content varies little.
  • Expecting a firm size from constant-quality VBR before encoding. The average is an outcome of the content.
  • Reading a displayed bitrate as fixed. For a variable file the number shown may be an average or a peak, depending on the tool. What is bitrate explains the basics.
  • Forgetting overhead. Even a perfect CBR stream sits inside a container that adds its own bytes.

FAQ

Is VBR smaller than CBR?

Not by definition. File size is average bitrate × duration ÷ 8. Two files with the same average and the same length have the same size, whichever mode produced them. A constant-quality VBR setting simply chooses its own average.

How do I estimate the size of a VBR file?

Multiply its average bitrate by its duration in seconds and divide by 8. If a tool shows only the peak, your estimate will come out high.

Why do some streaming playlists list two bit rates?

RFC 8216 defines a required peak value and an optional average value for each variant stream. The peak describes the busiest stretch, and the average describes the whole.

Does a CBR file always match the formula exactly?

It matches for the stream the setting describes. The container adds bytes, and RFC 6716 notes that the mode MP3 and AAC call CBR uses a bit reservoir. Expect a close match and verify with the real file.

Sources

  1. MDN Web Docs, Digital audio concepts. Accessed November 6, 2026.
  2. MDN Web Docs, Web audio codec guide. Accessed November 6, 2026.
  3. IETF, RFC 8216: HTTP Live Streaming. Accessed November 6, 2026.
  4. IETF, RFC 6716: Definition of the Opus Audio Codec. Accessed November 6, 2026.