Find the aspect ratio of any image or video from its width and height, or work out the missing width or height when you know the ratio you need. Pick a common ratio like 16:9 or 4:3 or type your own, and get the matching size, a table of sizes at common widths and the CSS aspect-ratio line ready to paste.
An aspect ratio describes shape without size. 16:9 means the width is sixteen units for every nine units of height, whether the picture is 320 pixels wide or 3840. Two images with the same ratio can be scaled to each other without cropping or distortion, which is why designers fix the ratio first and let the size follow.
Common shapes have common uses. 16:9 suits video and wide banners, 4:3 and 3:2 are classic photo shapes, 1:1 is the square used for avatars and grid posts, and tall shapes like 4:5 and 9:16 suit phone screens and stories. The best choice is the shape of the space where the image will sit.
To scale an image, multiply both sides by the same factor. If you only know the new width, the new height is the new width divided by the decimal ratio (width divided by height). This tool does that sum for you in both directions, and the decimal value it shows is the number you can use in a spreadsheet or script.
On a web page, set the width and let the height follow from the ratio, either with the CSS property or by giving images width and height attributes. Browsers use those values to reserve space before the image downloads, which keeps text from jumping around as the page loads.
Divide the width and the height by their greatest common divisor. For 1920 by 1080 the divisor is 120, so the ratio is 1920 / 120 : 1080 / 120 = 16:9.
Multiply the width by the ratio's height part and divide by its width part. For a 16:9 image that is 1280 pixels wide, the height is 1280 x 9 / 16 = 720 pixels.
Multiply the height by the ratio's width part and divide by its height part. For a 4:3 image that is 600 pixels tall, the width is 600 x 4 / 3 = 800 pixels.
It lets a box keep a fixed shape as it resizes: aspect-ratio: 16 / 9; on an element with a set width gives it a height of nine sixteenths of that width. The calculator prints this line for the ratio you chose.
Many sizes are rounded for convenience, so the exact ratio is a long fraction. The tool shows the exact ratio and also names the closest common shape so you can see what the size is meant to be.
Related: Social media image sizes, Image compressor, WebP converter.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.