Aspect Ratio Padding Calculator (Letterbox / Pillarbox)
Calculate the letterbox or pillarbox bar size in pixels when fitting a source of one aspect ratio into a frame of another, with a visual preview. Runs in your browser.
Fitting a source of a different aspect ratio into a fixed frame leaves bars: a wider source gets letterbox bars top & bottom, a narrower source gets pillarbox bars left & right. The image is scaled to fit (contain) without cropping; bar size each side = (frame dimension โ scaled image dimension) รท 2. Everything runs in your browser.
About this tool
Whenever an image or video whose shape (aspect ratio) differs from the frame it must fill is displayed without cropping or stretching, the leftover space shows up as bars โ and this calculator tells you exactly how big those bars are. Fit a wider-than-the-frame source (a 2.39:1 cinematic clip in a 16:9 frame) and you get letterbox bars across the top and bottom; fit a narrower source (a 4:3 clip or a vertical 9:16 video in a 16:9 frame) and you get pillarbox bars down the left and right. The tool scales the source to fit inside the frame (the 'contain' behavior), then computes the displayed image dimensions and the bar thickness on each side as (frame dimension โ scaled image dimension) รท 2. You enter the frame's pixel dimensions and the source aspect ratio (with one-tap presets for common ratios like 16:9, 4:3, 2.39:1, 1.85:1, square, and vertical), and it returns the bar size per side, the total bar area, the rendered image size, and a live visual preview so you can see the layout. This is the everyday math behind video editing and encoding (adding black bars so footage fits a delivery spec without distortion), web and app design (placing mismatched media in fixed containers), digital signage, and preparing images for social platforms with fixed canvas sizes. Because it always preserves the source's proportions, nothing is squashed โ the trade-off is the empty bar space, which this tool quantifies precisely. Everything runs in your browser; nothing is uploaded.
How to use it
- Enter the target frame's width and height in pixels.
- Enter the source aspect ratio, or tap a preset (16:9, 4:3, 2.39:1, etc.).
- Read whether it letterboxes or pillarboxes and the bar size on each side.
- Check the visual preview to confirm the layout.
Frequently asked questions
- What is the difference between letterbox and pillarbox?
- Letterbox adds bars on the top and bottom (when the source is wider than the frame); pillarbox adds bars on the left and right (when the source is narrower than the frame). Both preserve the source's proportions without cropping.
- How is the bar size calculated?
- The source is scaled to fit inside the frame without cropping. The bar on each side = (frame dimension โ scaled image dimension) รท 2. For a 2.39:1 source in a 1920ร1080 frame, the image is 1920ร803, leaving about 138px bars top and bottom.
- Why not just stretch the image to fill the frame?
- Stretching distorts the image (circles become ovals, people look squashed or stretched). Letterboxing/pillarboxing keeps the original proportions intact, which is why it is the standard for film and professional video.
- What aspect ratio is cinematic 2.39:1?
- 2.39:1 (often called "Scope" or anamorphic widescreen) is a common theatrical film ratio. Shown in a 16:9 (1.78:1) frame it requires letterbox bars because it is much wider than the frame.
- Can this handle vertical video?
- Yes. A 9:16 vertical source in a 16:9 horizontal frame is much narrower than the frame, so it pillarboxes with wide bars on the left and right. Use the 9:16 preset.
- Is anything uploaded?
- No. Only the dimensions you enter are used; all calculation runs in your browser.