1) Simplify an Image Ratio
2) Find Missing Dimension (Keep Aspect Ratio)
Tip: After simplifying a ratio above, values are auto-filled here.
3) Fit an Image in a Container (Contain / Cover)
Why image aspect ratio calculation matters
If your photos ever looked stretched, your thumbnails looked cropped in weird places, or your social posts were cut off, aspect ratio is usually the cause. Image aspect ratio calculation helps you keep images proportional while resizing, designing layouts, and preparing assets for websites, video, ads, and print.
In simple terms, an aspect ratio is the relationship between width and height. It is written as width:height, like 16:9, 4:3, or 1:1. The ratio does not represent exact pixels; it represents the shape of the image.
Core formula for aspect ratio
Step 1: Start with width and height
Suppose your image is 1920 × 1080. The raw ratio is 1920:1080.
Step 2: Simplify using greatest common divisor (GCD)
Divide both numbers by their GCD. For 1920 and 1080, the GCD is 120:
- 1920 ÷ 120 = 16
- 1080 ÷ 120 = 9
So the simplified ratio is 16:9.
How to calculate a missing dimension
Once you know ratio width and ratio height, you can scale to any size:
- New Height = New Width × (ratioHeight / ratioWidth)
- New Width = New Height × (ratioWidth / ratioHeight)
Example: You want 16:9 and already know width is 1200 px. Height = 1200 × (9 / 16) = 675 px.
Common image aspect ratios and where they are used
- 1:1 – square profile photos, social feed tiles
- 4:3 – older monitors, many digital cameras, presentation slides
- 3:2 – DSLR photo default and prints
- 16:9 – HD video, YouTube, modern screens
- 21:9 – ultrawide cinematic banners and hero images
- 9:16 – vertical video for Shorts, Reels, TikTok
Contain vs cover: practical web design sizing
Contain
The entire image is visible inside the container. No cropping happens, but you may get empty space on one axis.
This is similar to CSS object-fit: contain;.
Cover
The container is completely filled. Cropping can happen on one axis.
This matches CSS object-fit: cover;.
The calculator above includes both contain and cover so you can choose based on your design goal.
Best practices for clean, professional results
- Decide the target ratio before exporting images.
- Resize proportionally—never independently scale width and height unless distortion is intentional.
- Use high-resolution source files to avoid blur after crop/resize.
- For responsive web layouts, define ratio boxes to reduce layout shift.
- Test portrait, landscape, and square assets across devices.
Quick troubleshooting checklist
Image looks stretched
Width and height were changed with different scale factors. Recalculate one side from the original ratio.
Important content is cropped
Cover mode likely removed edges. Try contain mode or reposition focal point before export.
Thumbnails don’t match grid
Source images use mixed ratios. Batch-crop all assets to a single target ratio.
Final takeaway
Image aspect ratio calculation is one of the simplest skills that produces immediate visual improvement. Get the ratio right, and your images look natural, your UI feels consistent, and your content appears far more polished. Use the calculator at the top whenever you need to simplify ratios, compute missing dimensions, or fit media into fixed containers.