Aspect Ratio Calculator
Solve the missing width or height for any aspect ratio, from 16:9 to a custom shape.
Aspect ratio
Edit for a custom ratio.
Type a width or height and the other updates to match the ratio.
How to calculate an aspect ratio
Choose a ratio
Click a preset like 16:9, 4:3, 3:2, 1:1, 21:9, or 9:16, or type any two positive numbers for a custom ratio, decimals included.
Type a width or a height
Enter the dimension you know. The other field recalculates instantly so the proportion holds, rounded to the nearest whole pixel.
Read the result
A live preview draws the shape to scale, and the result panel shows the final dimensions, the ratio reduced to its simplest form, and the matching CSS aspect-ratio declaration.
Copy the dimensions
Click Copy dimensions to put the width and height on your clipboard, ready to paste into a design tool or an export dialog.
Why use this tool
Works in both directions
Edit the width and the height updates; edit the height and the width updates. You can always start from whichever dimension is fixed.
Six presets plus custom ratios
Common shapes (16:9, 4:3, 3:2, 1:1, 21:9, 9:16) are one click away, and the ratio fields accept any positive numbers, including decimals like 1.85:1.
CSS aspect-ratio output
Alongside the pixel dimensions you get a ready-made aspect-ratio declaration to paste into a stylesheet.
Simplified ratio readout
Enter 1920:1080 as the ratio and the tool reduces it to 16 : 9, which is useful for identifying what shape a resolution actually is.
Live proportion preview
A rectangle drawn to scale shows the exact shape of the ratio as you type, so you can see whether a frame is wide, tall, or square before you commit to numbers.
Free and local
No account, no quota, and the arithmetic runs entirely in your browser.
About this tool
This aspect ratio calculator solves the missing dimension for any proportion. Choose one of six presets covering 16:9, 4:3, 3:2, 1:1, 21:9, and 9:16, or type your own numbers, including decimals such as 1.85:1 for a cinema frame. Then enter either a width or a height: the other field recalculates immediately, rounded to the nearest whole pixel. A preview box draws the shape to scale so you can see the proportion at a glance, and the result panel also reduces the ratio to its simplest form and prints the matching CSS aspect-ratio declaration.
Typical jobs are concrete ones: working out how tall a 1200 pixel wide hero image should be, sizing a YouTube thumbnail at exactly 16:9, checking whether a frame fits a 21:9 ultrawide crop, or reserving space for an embed so the page does not jump while it loads. Because the calculation runs in both directions, you can start from whichever dimension is fixed, a column width in a layout or a row height in a grid.
The math is plain arithmetic executed in your browser, so the page works offline and nothing you type is sent anywhere. Once you have the target dimensions, the image resizer scales a picture to those exact pixels, and the image cropper trims one to the shape you calculated.
Frequently asked questions
- How does the aspect ratio calculator work?
- Choose a ratio or enter a custom one, then type a width or a height. The calculator fills in the other dimension so the proportion stays exactly the same. Editing either field recomputes the other live.
- What is an aspect ratio?
- An aspect ratio describes the proportional relationship between width and height, written as width:height, such as 16:9. It stays constant no matter the size, so a 16:9 image looks the same shape at 1280x720 or 1920x1080.
- Can I use a custom ratio?
- Yes. Enter any two numbers for the ratio, for example 1.85:1 for a cinema frame or 5:4 for print. The presets cover common cases like 16:9, 4:3, 3:2, 1:1, 21:9, and 9:16, and you can override them anytime.
- Why might the result be a decimal?
- Dimensions are rounded to the nearest whole pixel, since you cannot have a fraction of a pixel. For some ratios the exact value falls between integers, so the rounded result may be off by one pixel from a perfect ratio.
- Is anything uploaded?
- No. The calculation runs entirely in your browser with JavaScript. Nothing is sent to a server, stored, or logged.
Related tools
Image Resizer
Resize a batch of JPEG, PNG, and WebP images by percent, longest edge, fit-in-box, or exact pixels.
Image Cropper
Crop a photo to any size or a fixed aspect ratio, right in your browser.
Analogous Color Generator
Turn any base color into a three swatch analogous palette by rotating its hue.
CSS Box Shadow Generator
Dial in a CSS box-shadow with live preview and copy the exact code.
CMYK to RGB Converter
Convert CMYK ink percentages to RGB and hex with a live swatch, plus a reverse RGB to CMYK view. Copy any format.
Color Blindness Simulator
See how an image looks under common types of color vision deficiency.