Movie Encoder
Windows 10 & 11 Buy license · $79.95
Quality & settings

How to Calculate the Bitrate for a Target File Size: Formula, Examples and Table

Work out the video bitrate needed to hit a file size: the formula, worked examples, a quick reference table and the unit traps that make files too big.

Updated 4 minute read The Movie Encoder team

To work out the bitrate for a target file size, convert the size to kilobits and divide by the duration in seconds: total bitrate (kbps) = size in MB x 8,000 / seconds. Then subtract the audio bitrate and leave a small margin for container overhead. What remains is your video bitrate. Encode with two-pass at that bitrate and the file will land close to your target.

This guide walks through the formula step by step, with worked examples and a quick reference table. It also covers the unit traps (MB versus MiB, kilobits versus kilobytes) that make files come out too big, and what to do when the numbers say your target simply isn't realistic.

The formula

File size is just bitrate multiplied by time. Rearranged:

  1. Convert the target size to kilobits. One megabyte (MB, decimal) is 1,000,000 bytes, and one byte is 8 bits. So 1 MB = 8,000 kilobits.
  2. Divide by the duration in seconds to get the total bitrate in kbps.
  3. Subtract the audio bitrate, for example 128 kbps for stereo AAC.
  4. Subtract an overhead margin. Container overhead is usually small, around 1-2% for MP4 and MKV, but aiming 2-5% under the limit protects you against rounding and rate-control drift.

Video bitrate = (size MB x 8,000 / seconds) - audio kbps - margin

Worked examples

Example 1: a 10-minute video in 100 MB

  • 100 x 8,000 = 800,000 kilobits
  • Duration: 10 minutes = 600 seconds
  • Total bitrate: 800,000 / 600 = about 1,333 kbps
  • Minus 128 kbps audio = 1,205 kbps
  • Minus about 3% margin = roughly 1,170 kbps video

Example 2: a 45-second clip under 10 MB

  • 10 x 8,000 = 80,000 kilobits
  • 80,000 / 45 = about 1,778 kbps total
  • Minus 96 kbps audio = 1,682 kbps
  • Minus about 5% margin (small files leave less room for error) = roughly 1,600 kbps video

Example 3: 2 hours in 4 GB

  • 4 GB = 4,000 MB, and 4,000 x 8,000 = 32,000,000 kilobits
  • 2 hours = 7,200 seconds, so 32,000,000 / 7,200 = about 4,444 kbps total
  • Minus 192 kbps audio = 4,252 kbps
  • Minus about 2% margin = roughly 4,170 kbps video

Quick reference: total bitrate by size and duration

These are total bitrates (video plus audio) before any margin, rounded down.

Target size30 seconds1 minute5 minutes10 minutes30 minutes
8 MB2,133 kbps1,066 kbps213 kbps106 kbps35 kbps
10 MB2,666 kbps1,333 kbps266 kbps133 kbps44 kbps
25 MB6,666 kbps3,333 kbps666 kbps333 kbps111 kbps
50 MB13,333 kbps6,666 kbps1,333 kbps666 kbps222 kbps
100 MB26,666 kbps13,333 kbps2,666 kbps1,333 kbps444 kbps
500 MB-66,666 kbps13,333 kbps6,666 kbps2,222 kbps

Unit traps that make files too big

  • MB versus MiB. Windows File Explorer reports sizes in binary units (1 "MB" in Explorer is 1,048,576 bytes) but labels them MB. Upload limits are usually decimal, but not always. If you don't know which one a service uses, calculate with the smaller decimal figure.
  • Bits versus bytes. Bitrates are in kilobits per second (kbps, lower-case b). File sizes are in megabytes (MB, upper-case B). Forgetting the factor of 8 gives a file eight times too large.
  • Forgetting audio. Audio comes out of the same budget. At low targets, a 192 kbps audio track can take a large share of the total. Dropping to 96-128 kbps AAC, or about 64-96 kbps Opus in WebM or MKV, frees up bits for the picture.
  • Measuring duration wrongly. Use the real duration of the output. If you trim the video, calculate from the trimmed length.

Encoding at the calculated bitrate

Use two-pass encoding. The first pass analyses the whole video, so the second pass can share the budget sensibly and land close to the target. Using Example 1 (1,170 kbps video, 128 kbps audio):

ffmpeg -y -i input.mp4 -c:v libx264 -b:v 1170k -preset slow -pass 1 -an -f null NUL

ffmpeg -i input.mp4 -c:v libx264 -b:v 1170k -preset slow -pass 2 -c:a aac -b:a 128k output.mp4

On macOS or Linux, replace NUL with /dev/null. Single-pass bitrate mode is less accurate and distributes quality less well. CRF is the wrong tool here because it can't promise a size. Our CRF vs two-pass guide explains why.

Is the bitrate high enough?

The calculator will always give you a number, but it can't tell you whether that number will look acceptable. Very roughly, for H.264:

  • 1080p at 30 fps usually wants at least a few thousand kbps to look clean. Below about 2,000 kbps, detailed or fast-moving content usually shows obvious artefacts.
  • 720p can look acceptable at around 1,000-2,500 kbps, depending on content.
  • Below about 1,000 kbps, 480p or lower usually looks better than a blocky higher resolution.

These are only ballpark figures. Screen recordings and talking heads compress far better than sport or grainy film. If your budget is tight:

  • Lower the resolution. Fewer pixels per frame means more bits for each one.
  • Use a more efficient codec. HEVC or AV1 typically need noticeably less bitrate than H.264 for similar quality, provided the recipient can play them. See H.264 vs H.265.
  • Reduce the frame rate for content that doesn't need it, for example 60 fps screen recordings down to 30 fps. Our guide to changing video frame rate shows how.
  • Trim anything that doesn't need to be there.

For platform-specific limits and tips, see compressing video for email or Discord.

Hardware encoders and size targets

GPU encoders don't support the classic two-pass log-file workflow. With NVENC, Quick Sync or AMD, use VBR with your calculated average bitrate, a sensible max bitrate, and NVENC's -multipass option if available. Expect the size to drift a little more than with software two-pass, so leave a bigger margin, around 5-8%.

Doing it with Movie Encoder

Movie Encoder has a target file size mode, so you don't have to do the arithmetic by hand. Enter the size you need, and it works with two-pass and average bitrate rate control to hit it, with audio bitrate, resolution and frame rate all adjustable in the same place. The command preview shows the exact FFmpeg arguments for each pass.

If you aren't sure the result will look good at that size, the Smart Encoding Advisor's Smallest file goal suggests codec, resolution and audio settings with a file-size range. You can also trim the video first to save space.

Frequently asked questions

What is the formula for bitrate from file size?

Multiply the size in megabytes by 8,000 and divide by the duration in seconds to get the total kbps. Then subtract the audio bitrate and a small safety margin to get the video bitrate.

Why is my file bigger than the target?

Usual causes are mixing up bits and bytes, forgetting to subtract audio, binary versus decimal megabytes, or using single-pass or CRF instead of two-pass encoding.

How much margin should I leave?

Around 2-5% is usually enough for software two-pass encodes. Leave a little more for very small files or hardware encoders, whose sizes drift more.

Get three guides like this every month, plus software update notices.Subscribe →