Aspect Ratio Calculator: Find a Ratio or Resize to Fit
Type in any width and height to get the simplified aspect ratio, the nearest standard ratio and the CSS to lock it in. Then enter a new width or height to resize without stretching. A ratio is just width divided by height, so scaling both sides by the same factor never distorts the image.
Aspect ratio and resize calculator
Any unit works (pixels, centimetres, inches) as long as width and height use the same one.
How the aspect ratio is worked out
The calculator divides width and height by their greatest common divisor, the largest whole number that goes into both. 1920 and 1080 share a divisor of 120, so 1920 × 1080 becomes 16:9. Decimal inputs are scaled up to whole numbers first, so 1.5 × 1 gives 3:2.
Some real screen sizes do not reduce neatly. 1366 × 768 simplifies to 683:384, which is why the result also shows the decimal ratio (about 1.78:1) and the nearest standard ratio with how far off it is. Ultrawide monitors are a similar case: 2560 × 1080 is sold as "21:9" but is exactly 64:27, about 1.6% wider.
Resizing without distortion
To keep the shape, multiply the original height by new width ÷ original width (or the reverse if you know the height). Shrinking 1920 × 1080 to 800 wide gives 800 × 1080 ÷ 1920 = 450. When the answer is not a whole number of pixels, the result shows the exact value and the nearest pixel; rounding changes the ratio by a fraction of a pixel, which nobody will see.
Locking a ratio in CSS
Modern browsers support the aspect-ratio property, so a video or image placeholder can reserve the right space before it loads and avoid layout shift. The older padding trick (padding-top as a percentage of width, equal to height ÷ width × 100) still works for legacy code, and the calculator gives you both. If you are setting up responsive type next to this, the px to rem converter and type scale calculator use the same base-size thinking.
More from Experimento
related resultsBest A/B Testing Tools in 2026, Compared by What They Actually Do
A practical 2026 comparison of the best A/B testing tools by what each one is actually good at, from Optimizely and VWO to GrowthBook and PostHog.
read result →A/B Testing Tools Compared: Which Platform Fits Your Team
A/B testing tools compared for 2026: VWO, Optimizely, AB Tasty, Convert, GrowthBook, Statsig and PostHog, matched to marketing, CRO and engineering teams.
read result →Data-Driven Design: Let Research Guide Your Product Decisions
A practical guide to data-driven design: how to pair analytics with user research, run honest tests, and make product decisions on evidence, not opinion.
read result →