Video Bitrate Calculator: Bitrate Needed to Hit a Target File Size
Find the video bitrate to encode at so a clip fits a file-size limit: total and video bitrate after audio tracks and container overhead, MB vs MiB, bits per pixel, and a check against YouTube’s recommended bitrates for 360p to 4K.
How it works
Total bitrate (kbps) = target size (bytes) × (1 − overhead %) × 8 ÷ 1,000 ÷ length (s) · Video bitrate = total − audio bitrate × audio tracks · Bits per pixel = video bitrate (bit/s) ÷ (width × height × fps) · 1 MB = 1,000,000 bytes, 1 MiB = 1,048,576 bytes
File size, length and bitrate are locked together: size in bits = bitrate × seconds. To hit a size limit, convert the target to bits, divide by the running time to get the total bitrate, then subtract the audio track (or tracks) to see what is left for the picture. Enter that video bitrate in a two-pass or constant-bitrate encode; single-pass quality modes (CRF) do not aim at a size. Two details trip people up. First, units: drive makers and this calculator’s MB use 1,000,000 bytes, but Windows and many encoders show MiB (1,048,576 bytes) labelled “MB”, which is 4.9% larger. Second, the container (MP4, MKV) adds headers and an index, usually under 2%, so set a small overhead under More options when the limit is strict. The quality check divides the video bitrate by the pixels drawn each second (bits per pixel) and compares it with YouTube’s recommended upload bitrates: 8 Mbps for 1080p and 35–45 Mbps for 4K at 24–30 fps, and about 1.5 times that at 48–60 fps. Those are generous upload targets; streaming services deliver at lower rates using newer codecs.
Worked example
Fitting a 10-minute clip into 500 MB: 500 × 1,000,000 bytes × 8 = 4,000,000,000 bits, ÷ 1,000 = 4,000,000 kilobits, ÷ 600 seconds = 6,667 kbps, or 6.67 Mbps in total. Reserving 128 kbps for one audio track leaves 6,539 kbps for video. At 1080p and 30 fps that is 6,539,000 ÷ (1920 × 1080 × 30) = 0.105 bits per pixel, about 82% of YouTube’s 8 Mbps recommendation.
Sources: YouTube Help: Recommended upload encoding settings (bitrates) · Wikipedia: Bit rate (size = bitrate × time ÷ 8, CD-DA example) · dr-lex.be: Video bitrate calculator (overhead and MB vs MiB) · Moonb: Video bitrate calculator
Frequently asked questions
How do I calculate bitrate from file size?
Bitrate = file size in bits ÷ duration in seconds. A 500 MB file is 4,000 megabits; over 600 seconds that is 6.67 Mbps in total. Subtract the audio bitrate to get the video bitrate to enter in your encoder.
What bitrate should I use for 1080p or 4K?
YouTube recommends uploading 1080p at 8 Mbps (12 Mbps at 48–60 fps) and 4K at 35–45 Mbps (53–68 Mbps at high frame rate) with H.264. For local files or newer codecs such as H.265 and AV1 you can usually go 30–50% lower for similar quality.
Why is my encoded file bigger than the target?
Usually units or overhead. If your app counts 1 MB as 1,048,576 bytes, a “500 MB” limit is about 524 million bytes, so choose MiB. The container also adds headers, and single-pass encoders overshoot; leave 2–3% margin and use two-pass encoding.
Does the bitrate include audio?
The total bitrate covers everything in the file. The calculator subtracts the audio bitrate times the number of audio tracks, so the video figure is what to enter as the target video bitrate.
What is bits per pixel?
Bits per pixel is the video bitrate divided by width × height × frame rate. It lets you compare quality budgets across resolutions and frame rates. As a rough guide, around 0.1 bpp is common for H.264 web video at 1080p30 and much lower values tend to look blocky in motion, but grain, motion and the codec matter a lot.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.