Black bar size calculator

Letterbox & pillarbox calculator

Fit an image or video inside a different frame without cropping or stretching. Get the scaled content dimensions, exact bars on every edge and active screen percentage.

Source and output frame

No file upload
The selected color is used in the preview and generated FFmpeg command.
Centered contain fit
Letterbox: 140 px top + 140 px bottom
Source 12:5Frame 16:9Active 74.07%Bars 25.93%
Scaled content1,920 × 800 px
Scale factor1.0000×
Top / bottom140 / 140 px
Left / right0 / 0 px
All source content is preserved. Bars fill the unused 280 pixels of frame height.
FFmpeg scale + pad commandAssumes a square-pixel source
ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease:force_divisible_by=2:reset_sar=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:color=0x000000" -c:a copy output.mp4

What this black bar calculator measures

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.

Letterbox, crop or stretch?

Contain with bars

Preserves the entire source and its proportions. Unused frame space becomes letterbox or pillarbox bars.

Cover with crop

Fills the output frame without bars, but removes source edges. Measure the loss with the crop loss calculator.

Stretch to fill

Uses the whole frame without bars or cropping, but changes proportions and visibly distorts the content.

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. A separate pixel aspect ratio calculator will cover storage, sample and display ratios later.

Frequently asked questions

Do black bars reduce image quality?

The bars do not crop or stretch the source. Quality can still change if the source is scaled or the video is re-encoded, but padding itself does not remove visible source content.

Why are the two bars sometimes one pixel different?

An odd number of unused pixels cannot be divided into two equal whole-pixel bars. A centered result places the extra pixel on the bottom or right edge.

Are black bars always black?

No. Black is conventional, but padding can use another color or a designed background. Choose a color above to update the preview and FFmpeg command.

What happens when source and frame ratios match?

The source scales proportionally to fill the frame with no bars. The result is reported as a perfect fit.

Does this tool edit or upload a video?

No. It only calculates geometry from numbers in your browser. The optional FFmpeg command can be run locally on your own file.

Related tools and ratio guides