Aspect Ratio Calculator
NEWFind the aspect ratio of any size, scale dimensions proportionally and get CSS aspect-ratio code.
Runs 100% in your browser — your input is never uploaded or stored on our servers.
| Width | Height |
|---|---|
| 320 px | 180 px |
| 480 px | 270 px |
| 640 px | 360 px |
| 800 px | 450 px |
| 1024 px | 576 px |
| 1280 px | 720 px |
| 1600 px | 900 px |
| 1920 px | 1080 px |
| 2560 px | 1440 px |
| 3840 px | 2160 px |
.box {
aspect-ratio: 16 / 9;
width: 100%;
}.box {
position: relative;
width: 100%;
padding-top: 56.25%; /* 9 / 16 = 56.25% */
}
.box > * {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}Quick Examples
Typical inputs and the results this tool produces.
Overview
An aspect ratio is the proportional relationship between the width and the height of a rectangle, written as two numbers such as 16:9. It tells you the shape of a screen, video, photo or image without saying how many pixels it has. 1920×1080, 1280×720 and 3840×2160 all share the same 16:9 ratio.
This aspect ratio calculator reduces any width and height to the simplest ratio using the greatest common divisor, shows the decimal value and orientation, and names well-known ratios such as 16:9, 4:3, 21:9 or 9:16. Sizes that are almost a standard ratio, like 1366×768, are flagged as very close to it.
Then scale: type a new width to get the matching height, or a new height to get the width, with optional rounding to whole pixels. A table lists the height for common widths, and ready-to-paste CSS gives you the modern aspect-ratio property plus a padding-top fallback for older browsers. Everything runs in your browser.
Why use this tool?
- Simplest ratio via GCD, with decimal and orientation
- Recognises 16:9, 4:3, 21:9, 9:16 and other standards
- Solve the missing width or height while keeping the ratio
- CSS aspect-ratio and padding-top fallback code
- Visual box that shows the shape
Features
GCD simplification
Reduces any width and height, including decimals, to the smallest whole-number ratio.
Common-name hints
Tells you when a ratio is a known format and when it is within about 0.4% of one.
Solve missing dimension
Enter a new width to get the height, or a new height to get the width.
Size table
Heights for common widths from 320 to 3840 px at your ratio.
CSS output
aspect-ratio property plus a padding-top fallback for old browsers.
Visual box
See the exact shape of your ratio at a glance.
How to Use
Enter width and height
Type the original size, or click a preset such as 16:9 or 4:5.
Read the ratio
See the simplified ratio, decimal value, orientation and any common name.
Scale to a new size
Type a new width or a new height; the other value is calculated and rounded if you wish.
Copy the CSS
Copy the aspect-ratio snippet or the padding-top fallback into your stylesheet.