Skip to content

Aspect Ratio Calculator

Simplify a width and height to an aspect ratio, scale dimensions with a ratio lock, and copy the CSS aspect-ratio value, with common presets.

Aspect Ratio Calculator

Presets
Simplified ratio
16:9
Decimal ratio
1.7778
CSS
aspect-ratio: 16 / 9

Ratio 16:9

Scale proportionally

Uses the ratio above (1.7778) to scale a single dimension.

Height: —
Width: —

Updated . Provided as is. Check the output before you rely on it in production.

How to use Aspect Ratio Calculator

  1. 1

    Enter your dimensions

    Type a width and height into the two input fields, or click a preset button like 16:9 or 4:3 to fill them in for you.

  2. 2

    Read the results

    The simplified ratio, decimal ratio, and CSS aspect-ratio value appear immediately below the inputs as you type.

  3. 3

    Lock and scale

    Toggle the lock to preserve the ratio, then change one dimension and the other adjusts automatically to stay proportional.

  4. 4

    Copy the CSS

    Press Copy CSS to put the aspect-ratio declaration on your clipboard, then paste it straight into your stylesheet.

Questions and answers

What is an aspect ratio calculator?
An aspect ratio is the proportion of width to height, written like 16:9. This calculator reduces any width and height to its simplest ratio, gives the decimal value and a CSS aspect-ratio declaration, offers common presets, and scales one dimension to match a new width or height.
Is the aspect ratio calculator free to use?
Yes. It runs in your browser with no account and no usage caps, so you can compute as many ratios as you need without restrictions.
Does this tool store the values I enter?
No. Every calculation happens locally in your browser. Nothing you type is uploaded, logged, or sent to any server.
How does the lock-ratio toggle work?
When locked, the calculator remembers the current ratio. Change the width and the height recalculates to match, so resized images and videos keep the same proportions.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/aspect-ratio-calculator/

For automation planning, fetch the canonical contract at /api/tool/aspect-ratio-calculator.json.