All tools

Aspect Ratio Calculator

Math

Calculate and convert aspect ratios, scale dimensions, and fit/cover boxes

Enter a width and height and get the simplified ratio, decimal value, and percentage back instantly, with a check against common ratios like 16:9, 4:3, and 21:9 so you know immediately if a resolution matches a standard format or is something custom. Enter a target ratio plus one known dimension and it solves for the matching one, which is the faster path when you're resizing an asset to fit a specific aspect rather than computing it by hand. Dedicated fit and cover calculators mirror CSS's `object-fit: contain` and `object-fit: cover` behavior exactly: fit scales content to stay fully visible (possibly leaving empty space), cover scales to fill the box completely (possibly cropping edges). Everything here is arithmetic; no actual image is read or resized, so pixel dimensions need to be correct going in.

aspectratiodimensionsscaleresolution

How to use Aspect Ratio Calculator

  • 1.Enter a width and height to get the simplified aspect ratio (e.g. 1920x1080 → 16:9) instantly.
  • 2.Enter a target aspect ratio and one known dimension to calculate the matching width or height for resizing an image or video.
  • 3.Use the fit/cover calculators to figure out the correct crop or letterbox dimensions when scaling media into a container with a different ratio.

Frequently asked questions

What's the difference between "fit" and "cover" modes?
"Fit" scales content to be fully visible inside a box (may leave empty space), while "cover" scales it to fill the box completely (may crop the edges) — the same distinction as CSS `object-fit: contain` vs `object-fit: cover`.
Does it round to whole pixels?
Yes, output dimensions are rounded to whole numbers since fractional pixels aren't meaningful for most image/video use cases.
Can it simplify unusual ratios like 1366x768?
Yes, it reduces any width/height pair to its simplest integer ratio using the greatest common divisor, even for non-standard resolutions.
Is my input sent anywhere?
No, all calculations run locally in your browser.

Use via API, SDK, or MCP

Installnpm install @utilix-tech/sdk
Usageimport { units } from '@utilix-tech/sdk'
const ratio = units.calcAspectRatio(1920, 1080)
console.log(ratio.ratio) // 16:9
const scaled = units.scaleByWidth({ width: 1920, height: 1080 }, 800)
console.log(scaled) // { width: 800, height: 450 }

Runs locally · no API key · no rate limits · Node.js SDK docs →