Aspect Ratio Calculator
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.
What you enter
- What do you want to do?
- Width
- Height
- Ratio
- Ratio width part
- Ratio height part
What you get
- Aspect ratio
- As a decimal (width / height)
- Closest common ratio
- Width
- Height
- Orientation
- CSS
How it works
- Choose what you want: find the ratio of a size you have, find a height for a width, or find a width for a height.
- To find a ratio, type the width and height in pixels. To find a missing side, pick a common ratio or choose custom and type your own, then type the side you know.
- Read the simplified ratio, the decimal value, the closest common shape and the matching size.
- Copy the CSS line into your stylesheet, or use the table to see the height at widths from 320 to 3840 pixels.
What an aspect ratio is
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.
Resizing without distortion
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.
Tips
- Resize by changing one side and calculating the other. Typing both sides by hand is how images end up squashed or stretched.
- If the ratio looks odd, such as 683:384, your size is probably a rounded version of a common ratio. 1366 by 768 is very close to 16:9, which the closest-shape line will point out.
- For social posts, check the platform's current recommended sizes before exporting. Common shapes are 1:1, 4:5 and 9:16, but the platforms change them from time to time.
- Use the CSS aspect-ratio property for responsive images and video embeds so the page reserves the right space before the file loads, which avoids layout jumps.
- Crop to a new ratio on purpose. Fitting a 3:2 photo into a 16:9 slot means cutting off part of it or adding bars, so decide which before you export.
Frequently asked questions
How do you calculate an aspect ratio?
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.
How do I find the height for a given width?
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.
How do I find the width for a given height?
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.
What is the CSS aspect-ratio property?
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.
Why does my ratio not match a common one exactly?
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.
More in Free Tools
- Avatar Placeholder Generator (Initials and Patterns)
- Band Name Generator
- Banner Fitter With Safe-Zone Preview
- Free Barcode Generator: Code 128, EAN-13 and UPC-A
- Base64 Encoder and Decoder
- Binary Converter
- Instagram Bio Generator for Businesses and Creators
- Blob Generator: SVG Shapes and Animated CSS Blobs
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App