About this calculator
A single-purpose tool for a problem that comes up constantly and has no good answer in a search box: given two of ratio, width and height, what is the third?
What it does
Enter any two values and the third appears as you type. Lock the ratio and it behaves like a proportional resize handle — change the width and the height follows. Unlock it and the two pixel fields define the ratio instead. Alongside the numbers you get a live preview of the shape, the decimal form of the ratio, the megapixel count, and a list of real-world resolutions that match.
How the maths is handled
- Reduction. Ratios are reduced to lowest terms with the Euclidean GCD algorithm, so 1920 × 1080 reads as 16:9 rather than 1920:1080.
- Decimals. Non-integer ratios such as 2.39:1 are scaled by 1000 before reducing, giving 239:100.
- Snapping. If a reduced ratio has a term above 32 and sits within 0.5% of a recognised standard, the standard is shown instead and a note reports the exact reduction and the error. Nothing is silently changed.
- Rounding. Computed dimensions round to the nearest whole pixel and never fall below 1.
- Guards. Zero, negative and empty inputs are ignored rather than propagated, so
NaN,Infinityand impossible ratios like-1:0never reach the screen.
What it deliberately does not do
It does not resize your files, does not judge whether an image has enough resolution for a given output, and does not model non-square pixels or anamorphic formats. It is a geometry tool. The platform pages add context about where interfaces cover the frame, but those are written descriptions, not measurements taken from a live app.
Principles
- The calculator needs no network. It makes no API call and waits on no server: the maths is plain JavaScript, alongside one small stylesheet, with no web font to download. Save the page and it still works offline.
- No accounts, and nothing you type is collected. The numbers you enter are never stored or transmitted; they never leave your device. See the privacy policy.
- Honest about uncertainty. Where a platform's exact pixel recommendation could have changed since this was written, the pages say so and describe the ratio instead, because ratios are far more stable than pixel counts.
- Keyboard first. Every control has a real label, the tab order follows the layout, and results are announced to screen readers as they update.
Corrections
If a number here is wrong or a platform has changed its specification, that is worth fixing. The contact page has an email address. Concrete corrections with a source are the most useful kind of message.