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
- Enter the original width and height to establish the source ratio.
- Enter a new width and leave the new height blank to calculate it.
- Alternatively enter the intended height and use the reported ratio to calculate the matching width.
- Review the simplified ratio and rounded dimensions.
- 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.
Standards and technical references
See the site-wide testing methodology for fixture categories, privacy checks and correction policy.
Frequently asked questions
How is an aspect ratio simplified?
Why is the calculated dimension a decimal?
What does object-fit cover do?
Can I use aspect-ratio for responsive embeds?
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.