Aspect Ratio Calculator

Calculate missing dimensions and simplified aspect ratios for images and video.

Tool input is processed locally in your browser and is not submitted to CodeNimbleTools. Avoid pasting production secrets into any device or website you do not fully trust.

About this tool

Aspect ratio is the proportional relationship between width and height. The Aspect Ratio Calculator simplifies an original ratio and calculates a missing scaled dimension so an image, video or responsive embed keeps the same shape without stretching.

For example, 1920 by 1080 simplifies to 16:9; changing the width to 1280 produces a height of 720. Rounding may be required when a ratio does not produce whole pixels, and the final crop can still differ if CSS uses object-fit: cover. Use the calculated ratio with the CSS aspect-ratio property to reserve space and reduce layout shift while media loads.

How to use it

  1. Enter the original width and height to establish the source ratio.
  2. Enter a new width and leave the new height blank to calculate it.
  3. Alternatively enter the intended height and use the reported ratio to calculate the matching width.
  4. Review the simplified ratio and rounded dimensions.
  5. Apply the values to the image, video or container and confirm whether cropping rules alter the visible result.

Useful ways to apply it

  • Resizing 16:9 video thumbnails without distortion.
  • Calculating responsive image dimensions for a fixed content width.
  • Simplifying camera, banner and social-media dimensions into a ratio.
  • Setting CSS aspect-ratio before media loads to reduce layout shift.
  • Checking whether two differently sized assets share the same proportions.

Worked example

Example input

1920 × 1080; new width 1280

Expected output

16:9; matching height 720px

Edge cases to check

  • Decimal dimensions are accepted, but real image/video dimensions are usually whole pixels.
  • A new width or height of zero is not meaningful.
  • CSS layout can still crop or distort media when object-fit or container constraints override the intrinsic ratio.

Known limitations

The calculator preserves a numeric width:height ratio; it does not inspect an actual image, video, crop, EXIF orientation or responsive container.

How this tool was reviewed

Reviewed with 16:9, 4:3, portrait, decimal and invalid zero/negative dimensions.

Last reviewed: September 3, 2026 · Maintainer: William

Standards and technical references

Frequently asked questions

How is an aspect ratio simplified?
The width and height are divided by their greatest common divisor, so 1920:1080 becomes 16:9.
Why is the calculated dimension a decimal?
Some source ratios do not map to a whole pixel at the chosen size. Round according to the target format and check the small resulting difference.
What does object-fit cover do?
It fills the container while preserving the media ratio, cropping the parts that do not fit. The source itself is not stretched.
Can I use aspect-ratio for responsive embeds?
Yes. A container with the correct CSS aspect-ratio can reserve space for video, iframe or image content while its width changes.

Privacy

Tool input is processed locally in your browser and is not submitted to CodeNimbleTools. Avoid pasting production secrets into any device or website you do not fully trust.