Contain fitEvery source pixel remains visible
What this black bar calculator measures
Start with a known output width and height. Unlike the canvas and crop converter, which can expand the source canvas to a new ratio, this tool keeps the output frame fixed and scales the complete source to fit it.
The calculator proportionally scales the source until it fits completely inside the output frame. It then divides the unused pixels between opposite edges. A one-pixel difference is shown when an odd number of pixels cannot be split equally.
scale = min(frame width ÷ source width, frame height ÷ source height)
unused width = frame width − scaled width
unused height = frame height − scaled height
The active percentage compares the scaled picture area with the complete output frame. The remaining percentage is padding, not lost image content.
When do letterbox bars appear?
Letterboxing adds horizontal bars above and below the picture. It happens when the source is wider than the output frame—for example, a 1920×800 cinematic image inside a 1920×1080 frame.
In that example the image stays 1920×800, leaving 280 unused vertical pixels: 140 at the top and 140 at the bottom.
When do pillarbox bars appear?
Pillarboxing adds vertical bars on the left and right. It happens when the source is narrower than the output frame. A 1440×1080 4:3 source inside a 1920×1080 16:9 frame leaves 480 horizontal pixels.
A centered fit places 240 pixels on each side and uses 75% of the output frame area.
Using the FFmpeg command
The generated filter first scales the video down to fit while preserving its aspect ratio, then pads it to the requested output dimensions and centers the active picture.
force_divisible_by=2 produces even scaled dimensions for common video encoders. As a result, FFmpeg bars can differ from the general pixel preview by one pixel in edge cases.
Method reference: FFmpeg scale filter and FFmpeg pad filter.
Important pixel aspect ratio note
The visual calculation assumes square pixels, which is standard for most modern web images and video. Older or anamorphic sources can store a sample aspect ratio other than 1:1, so their displayed shape may not equal width divided by height.
The generated command resets the scaled output to square pixels. Use the pixel aspect ratio calculator to normalize non-square-pixel dimensions before fitting the frame.