Aspect Ratio Calculator Widget
Add an aspect ratio calculator to your video, photography or web-design page. Readers enter a size or pick a common ratio such as 16:9 or 9:16, see the simplified ratio, and work out the matching height or width for any new size.
Live preview
Exactly what your visitors will seeUnder the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/aspect-ratio-calculator" title="Aspect Ratio Calculator by A2Z Tools" width="100%" height="760" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="aspect-ratio-calculator" data-height="760"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
The width and height are divided by their greatest common divisor, the method used by the A2Z Aspect Ratio Calculator page. Decimal sizes are first scaled to whole numbers, so 2.35 x 1 simplifies exactly to 47:20. Screen sizes that are almost a standard ratio, such as 1366 x 768, are shown with their nearest common ratio and how close it is. A resized dimension that is not a whole pixel is flagged with the value to round to, and a table lists common widths at the same ratio.
Calculation method
- Ratio = W / g : H / g, where g = gcd(W, H)
- New height = new width x H / W; new width = new height x W / H
- Closest common ratio = named ratio with the smallest relative difference in W / H, shown when within 2%
- Decimal inputs are scaled by 10^d (d up to 6 decimal places) before the gcd; resized sizes shown to 2 decimals with the nearest whole pixel
Worked examples
A laptop panel sold as 16:9
Inputs: Width 1366, height 768, new width 1280
Result: 683:384 (1.7786:1); closest common ratio 16:9, within 0.05%; height for width 1,280 = 719.65, round to 720
1366 and 768 share only the factor 2, so the exact ratio is 683:384. It is marketed as 16:9 because 16/9 = 1.7778, a 0.05% difference.
A portrait feed post
Inputs: Preset 4:5, new width 1080
Result: Height for width 1,080 = 1,350
1080 x 5 / 4 = 1350, the 1080 x 1350 size commonly used for portrait feed posts.
A cinema scope frame
Inputs: Width 2.39, height 1, new width 1920
Result: 239:100 (2.39:1); height for width 1,920 = 803.35, round to 803
The decimal is scaled to 239 x 100 before simplifying; 1920 / 2.39 is not a whole number, so the widget says which pixel to round to.
Limitations
- It works on display (pixel) aspect ratios only; anamorphic video with non-square pixels (pixel aspect ratio other than 1) is not converted.
- Rounding a resized dimension to a whole pixel slightly changes the ratio, which the widget reports but cannot avoid.
- It does not crop or resize images - it only calculates sizes.
- Platform size recommendations (Stories, Reels, feed posts) change; check the network's current help pages before a campaign.
Where publishers use it
- Video and YouTube guides about 16:9, 9:16 and 1:1 exports
- Photography sites explaining crop ratios such as 3:2 and 4:5
- Web-design tutorials on responsive images and embeds
- Social-media marketing pages listing post and story sizes
Questions
Why does 1366 x 768 show 683:384?
That is its exact simplified ratio. It is within about 0.05% of 16:9, which is why it is sold as a 16:9 screen; the widget shows both.
What if the new height is not a whole number?
The widget shows the exact value and suggests the nearest whole pixel. A tiny rounding changes the ratio by a negligible amount.
Which ratio do vertical videos use?
9:16 - for example 1080 x 1920 for Stories, Reels and Shorts.
Can I use decimal sizes such as 2.39:1?
Yes. Decimal widths and heights are scaled to whole numbers before simplifying, so nothing is rounded away.
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Aspect Ratio Calculator https://a2z.tools/aspect-ratio-calculator
<a href="https://a2z.tools/aspect-ratio-calculator">A2Z Tools Aspect Ratio Calculator</a>
[A2Z Tools Aspect Ratio Calculator](https://a2z.tools/aspect-ratio-calculator)
Aspect Ratio Calculator by A2Z Tools - https://a2z.tools/aspect-ratio-calculator
Related widgets
-
Convert pixels to rem (and back) for any root font size, with a table of common sizes.
-
Build a linear or radial CSS gradient with 2-5 colour stops and copy the code.
-
Length, mass, volume, area, temperature, speed, time, data, pressure, energy and power - exact factors.
-
WCAG 2.x contrast ratio of two colours, AA/AAA results and the nearest passing shade.
-
Convert any colour between HEX, RGB, HSL, HSV and CMYK, with a swatch and copy buttons.
-
Complementary, analogous, triadic, split, tetradic and monochrome palettes from one colour.