Bitrate & Storage Runs Locally in Your Browser

Aspect Ratio & Macroblock Resolution Scaler

Compute distortion-free upscaling and downscaling dimensions alongside mod-2, mod-4, mod-8, and mod-16 macroblock-aligned resolutions for hardware encoders.

Interactive Workspace: Resolution Scaler 100% Local Browser Processing (Zero Server Upload)
DISPLAY ASPECT RATIO & EXACT PROPORTION
16:9 (1.7778:1)
Exact unrounded size: 1920 x 1080.00 px
Macroblock-Aligned Dimensions (mod-2 to mod-16)
Modulo Aligned Dimensions Aspect Deviation FFmpeg Scale Flag
Dimensions aligned.

Methodology, Formulas & Parameter Reference

Every digital video frame is defined by three interrelated ratios: the Storage Aspect Ratio (SAR), which is the ratio of horizontal to vertical pixel columns (\(\text{SAR} = \frac{W}{H}\)); the Pixel Aspect Ratio (PAR), which describes the shape of an individual pixel (\(1:1\) for square pixels, or \(2:1\) / \(1.33:1\) for anamorphic lenses); and the Display Aspect Ratio (DAR), which is the physical geometry of the image shown on screen (\(\text{DAR} = \text{SAR} \times \text{PAR}\)).

When scaling a square-pixel timeline to a new width \(W_{\text{new}}\), the mathematically exact height is \(H_{\text{exact}} = W_{\text{new}} \times \frac{H_{\text{source}}}{W_{\text{source}}}\). However, video codecs do not encode individual pixels in isolation; they partition the frame into square macroblocks or coding tree units (CTUs) of \(16 \times 16\), \(8 \times 8\), or \(4 \times 4\) pixels, and chroma subsampling requires dimensions divisible by at least 2 (mod-2).

Classic example: scaling a 16:9 frame to a width of 1366 pixels yields \(1366 \times \frac{9}{16} = 768.375\) pixels, which is neither an integer nor divisible by 16. Similarly, standard 1920x1080 is divisible by 8 (mod-8) vertically, but \(1080 \div 16 = 67.5\), which is why H.264 encoders internally pad 1080p frames to 1920x1088 in bitstream memory and attach a cropping rectangle flag. This calculator computes the greatest common divisor (GCD) of your source frame and outputs the nearest mod-2, mod-4, mod-8, and mod-16 resolutions along with the exact sub-pixel aspect deviation in percent.

Encoder Macroblock Alignment Divisibility Standards
Alignment Modulo Block Size Codec / Pipeline Requirement 16:9 Example Resolution
mod-2 2x2 pixels Minimum requirement for YUV 4:2:0 chroma subsampling. 854x480 (FWVGA)
mod-4 4x4 pixels Transform block size in H.264/HEVC and WebGL textures. 1280x720, 1920x1080
mod-8 8x8 pixels DCT block boundary for JPEG, ProRes, and DNxHR. 1920x1080, 3840x2160
mod-16 16x16 pixels Full H.264 macroblock alignment without internal bitstream padding. 1280x720, 1920x1088, 3840x2160

Production Workflow Verification & Quality Control

Before committing a full batch transcode or publishing a final master, verify the generated parameters against a five-second test slice of your source timeline. In post-production pipelines, container metadata headers, variable frame rate (VFR) timebases from mobile or screen-capture recordings, and non-square pixel aspect ratios can alter how downstream players interpret stream flags. Running every calculation and file conversion locally in browser memory ensures your production assets remain private while providing deterministic numbers you can paste directly into terminal automation scripts, NLE export presets, or camera prep checklists.

Frequently Asked Questions

Why is 854x480 not a true 16:9 aspect ratio?

480 multiplied by 16/9 equals 853.33 pixels. Because 853 is an odd number that breaks 4:2:0 chroma subsampling, standard 480p web video rounds up to 854x480 (mod-2) or 848x480 (mod-16), resulting in a negligible 0.08% aspect ratio difference.

How do I de-squeeze 2x anamorphic footage in FFmpeg without losing vertical resolution?

Keep the vertical pixel count constant and multiply the horizontal width by the squeeze factor (for example, 2880x2160 with a 2x anamorphic lens scales to 5760x2160 before cropping to 2.39:1).

Which modulo alignment should I pick for modern social and web exports?

Choose mod-8 or mod-16 whenever possible so hardware decoders on older Android and smart TV chipsets do not display a green 8-pixel padding line along the bottom or right edge.