Detect From File

Reads pixel dimensions locally — nothing is uploaded
Drop an image or video, or click to browse
Dimensions are read in your browser — nothing leaves your device

Calculator

Fill any two fields — third auto-calculates
Unit
Dimensions & Ratio
×
=
:
Ratio (decimal)
Megapixels
Total pixels
Press Esc to reset all fields
Live Preview
16 : 9
Proportional visual — updates live

Common Ratio Presets

Social & Platform Sizes

Exact recommended dimensions

Scale to Size

Uses current ratio

Crop Calculator

Centered crop to current ratio
Enter original dimensions above — the crop box is calculated to fit the ratio set in the Calculator card.

Compare Ratios

Side-by-side visual comparison

Letterbox / Pillarbox Calculator

Content ratio uses the Calculator card
Enter a frame size above — bars are calculated for the ratio set in the Calculator card.

Common Resolutions

Select a preset or enter dimensions to see matching resolutions

Related Tools

Image Resizer Image Compressor Image Converter

How to calculate aspect ratio online

This calculator works out width, height, or ratio from any two known values — instantly, with no account and nothing installed. Here's everything you need to know, including tips for specific use cases and devices.

  1. 1

    Enter any two values, or detect them from a file

    Type in a width, a height, or a ratio (e.g. 16:9) — any two of the three fields is enough. Or drop an image/video into the "Detect From File" card and the exact pixel dimensions are read automatically.

  2. 2

    Pick a preset, a platform size, or browse resolutions

    Click any of the 12 common presets, or a named platform size like "Instagram Story" for exact pixel dimensions. The resolutions table updates to show standard sizes for the matching ratio.

  3. 3

    Scale, crop, or letterbox using the current ratio

    Once a ratio is set, use Scale to Size to find a matching dimension at a different size, Crop Calculator to find a centered crop box from a larger original, or the Letterbox/Pillarbox Calculator to work out bar sizes when fitting content into a different frame ratio.

How to find the aspect ratio of an image or video

Enter your image's width and height — leave the ratio fields blank — or drop the file directly into the "Detect From File" card. The calculator uses the greatest common divisor (GCD) to simplify the ratio automatically. For example, 1920 × 1080 simplifies to 16:9, and 800 × 600 simplifies to 4:3. If your dimensions don't match a standard ratio exactly, the nearest standard ratio is shown for reference.

How to calculate height from width and a ratio

Enter your width value, then set the ratio — either by typing in the ratio fields or clicking a preset. The height is calculated as width × ratio_H ÷ ratio_W. Calculated fields are highlighted in amber so you always know which value was derived versus typed.

How to calculate a centered crop

Set your target ratio in the Calculator card, then enter your original image's width and height into the Crop Calculator. It works out the largest centered box matching that ratio, along with the pixel offset from each edge — useful for cropping a photo to a specific ratio without distorting it.

What are letterboxing and pillarboxing?

Letterboxing adds black bars above and below content that's wider than the display frame; pillarboxing adds bars on the sides for content that's narrower. Set your content's ratio in the Calculator card and your target frame size in the Letterbox/Pillarbox Calculator to see the exact bar size in pixels.

What aspect ratio should I use for YouTube videos?

Use 16:9 for standard YouTube videos — recommended at 1920×1080 (Full HD) or 3840×2160 (4K). For YouTube Shorts, Reels, and TikTok, use 9:16 vertical at 1080×1920 — both are in the Social & Platform Sizes card above.

Why does this calculator not upload my data anywhere?

All math happens instantly in your browser using JavaScript — nothing is ever sent to a server, including files dropped into the "Detect From File" card, which are only ever read locally to measure their pixel dimensions. That means it works offline once the page has loaded, and it's safe to use with dimensions or files from private or confidential projects.

Bug Reports
No bugs reported yet — looking good.
Report a bug