Aspect Ratio Calculator

Calculate aspect ratios and pixel dimensions for media and screens.

Aspect Ratio Calculator

Result

reduced: 3:2
decimal: 1.5 : 1
CSS: aspect-ratio: 720 / 480;
nearest preset: Photo 3:2 (3:2)
orientation: landscape • pixel count: 345,600

Solve size from ratio

ratio (W:H)
:
given side
value (px)

Fit calculator

box width (px)
box height (px)
fit → 1080 × 720

Fit preview

What is an Aspect Ratio Calculator?

An aspect ratio calculator is a tool that computes the proportional relationship between an image or screen's width and height. Aspect ratio is expressed as two numbers separated by a colon (e.g., 16:9, 4:3, 1:1) and is critical for maintaining visual consistency when resizing images, designing responsive layouts, or specifying video dimensions.

CodeHelper's Aspect Ratio Calculator works in both directions: calculate the ratio from pixel dimensions, or determine missing dimensions from a known ratio and one side.

Common Aspect Ratios

  • 16:9: Standard widescreen for HD video, YouTube, and most monitors.
  • 4:3: Classic TV and older monitor format, still used in some presentations.
  • 1:1: Square format, popularized by Instagram profile images and thumbnails.
  • 9:16: Vertical video format for mobile, TikTok, Instagram Reels, and Stories.
  • 21:9: Ultrawide cinematic format for immersive displays and film.

How to use the Aspect Ratio Calculator

  1. Enter width and height in pixels to calculate the reduced ratio.
  2. Or enter a known ratio and one dimension to solve for the missing side.
  3. Use the fit/cover preview to visualize how your image fills a container.
  4. Copy the generated CSS aspect-ratio property for your stylesheet.

Fit vs Cover: what is the difference?

  • Object-fit: contain: Scales the image to fit entirely within the container. Preserves the original ratio but may leave empty space (letterboxing/pillarboxing).
  • Object-fit: cover: Scales the image to fill the container completely, cropping as needed. No empty space, but part of the image may be hidden.
  • CSS aspect-ratio property: Locks an element to a specific ratio so it scales proportionally as its width changes. Replaces the classic padding-bottom hack for responsive video embeds.

Whether you are designing responsive images, preparing video thumbnails, planning print layouts, or implementing CSS aspect-ratio containers, this free calculator ensures your dimensions are always mathematically correct.

Free forever, no ads, no tracking. Support the project