Free · No login required
Video Aspect Fit Calculator
Fit a source image inside a screen canvas without cropping and calculate its centered margins in pixels.
Source width (px): 1–65536; Source height (px): 1–65536; Canvas width (px): 1–65536; Canvas height (px): 1–65536
Inputs stay on this page and clear on refresh.
Video Aspect Fit Calculator
Source width (px): 1920 Source height (px): 1080 Canvas width (px): 1024 Canvas height (px): 768
- Fitted width (px)
- 1024.000000
- Fitted height (px)
- 576.000000
- Left / right margin (px each)
- 0.000000
- Top / bottom margin (px each)
- 96.000000
- Scale (%)
- 53.333333
Contain fit: scale = min(canvas width/source width, canvas height/source height). Multiply both source dimensions by this scale; each centered margin is half the unused canvas dimension. Example: 1920×1080 into 1024×768 gives 1024×576 with 96 px above and below. Dimensions must be integer pixels from 1 to 65536. Assumes square pixels, centered placement and no cropping; upscaling is allowed. Fractional results are ideal geometry, shown to six decimals. Your media server must choose a pixel rounding policy; this tool does not resample media or validate processor capacity.
Methodology
How it works
Contain fit: scale = min(canvas width/source width, canvas height/source height). Multiply both source dimensions by this scale; each centered margin is half the unused canvas dimension. Example: 1920×1080 into 1024×768 gives 1024×576 with 96 px above and below. Dimensions must be integer pixels from 1 to 65536. Assumes square pixels, centered placement and no cropping; upscaling is allowed. Fractional results are ideal geometry, shown to six decimals. Your media server must choose a pixel rounding policy; this tool does not resample media or validate processor capacity.
Method and assumptions documented by Techrider.live
2026-10-15
Frequently asked questions
Does this provide a crop or an encoded video?
No. This preserves the complete source aspect ratio inside the canvas. Empty space remains as letterboxing or pillarboxing; perform encoding and final pixel rounding in your playback software.