Aspect Ratio Calculator
Simplify a width and height, or find a missing side
About Aspect Ratio Calculator
Aspect Ratio Calculator reduces a width and a height to the smallest whole-number ratio and gives the decimal value (width divided by height, up to four decimals). Decimals are accepted and scaled first, so 2.39 and 1 give 239:100. Two extra fields answer the usual resizing question: type a new width to get the matching height, or a new height to get the width; when the answer is not a whole pixel, the exact value is shown next to the rounded one. Five presets load common sizes. Values must be positive numbers; anything else shows a dash instead of a ratio.
Example
A laptop screen size resized to a width of 1280, computed with the page's own code.
Typed in the fields
Width: 1366 Height: 768 New width → height: 1280
Shown by the calculator
683:384 Decimal: 1.7786 Height: 720 (≈ 719.648609, rounded)
How to calculate an aspect ratio and a missing side
- 1Type the original size in "Width" and "Height", or pick one of the "Common presets" such as 16:9 (1920×1080).
- 2Read the simplified ratio and the "Decimal" value; both change as you type.
- 3To resize, type the new width in "New width → height", or the new height in "New height → width".
- 4Read the result under that field: the value rounded to a whole pixel, followed by the exact value when it is not whole.
Formats and limits
- Accepted values
- Positive numbers, including decimals (2.35) and exponent form (1e3); zero, negative, or empty values give no ratio
- Results
- Simplified ratio, decimal ratio to four decimal places, and the missing side rounded to a whole pixel
- Presets
- 16:9 (1920×1080), 4:3 (1024×768), 1:1 (1080×1080), 21:9 (2560×1080), 9:16 (1080×1920)
Where your numbers are processed
The ratio and the missing side are computed by the page itself each time you type a digit. Your numbers are not sent to our servers or to anyone else, and nothing is saved: after a reload the fields go back to 1920 and 1080 and the resize fields are empty.
Frequently asked questions
Can it keep the aspect ratio when I resize an image?
Yes. Enter the original width and height, then type the new width in "New width → height": the height shown keeps the same proportions. For example, 1366 by 768 resized to a width of 1280 needs a height of 720, rounded from about 719.65 (the page shows ≈ 719.648609).
Is 1366 by 768 exactly 16:9?
No. 1366 divided by 768 is 1.7786, while 16:9 is 1.7778, so the calculator shows 683:384. It reduces the exact numbers you type and never rounds them to the nearest common ratio.
Can I enter decimal values such as 2.39 and 1?
Yes. Both values are scaled to whole numbers before they are reduced, so 2.39 and 1 give 239:100 with a decimal of 2.39. Exponent form such as 1e3 is read too; zero, negative, or empty values show a dash.
Can I use the decimal value in CSS?
Yes. It is the width divided by the height, rounded to four decimal places, and the CSS aspect-ratio property accepts a single number, for example aspect-ratio: 1.7778. CSS also accepts the ratio itself written as 16 / 9.
Tips and tricks
- ✓Picking a preset replaces both "Width" and "Height", so type your own size again before resizing.
- ✓Once you know the target size, Resize Image or Crop Image can produce the image itself.