Aspect Ratio Calculator

Calculate aspect ratios and resize dimensions while maintaining proportions for images, videos, and screens.

Dimensions

Resize Calculator

Aspect Ratio

16:9

HD/Widescreen

Visual Preview

1920 x 1080

Decimal Ratio
1.7778
Megapixels
2.07 MP
Total Pixels
20,73,600
Diagonal
2202.91px

CSS Aspect Ratio

aspect-ratio: 16 / 9;

What Is an Aspect Ratio?

An aspect ratio describes the proportional relationship between a rectangle's width and its height, expressed as two numbers separated by a colon — for example, 16:9 or 4:3. It tells you how wide something is relative to how tall it is, without specifying exact pixel counts. A 1920×1080 frame and a 1280×720 frame share the same 16:9 aspect ratio because both reduce to the same simplified fraction.

Aspect ratios appear everywhere in digital media. Monitors, smartphones, TVs, digital cameras, social-media platforms, and video-conferencing software all operate within fixed ratio constraints. Choosing or respecting the correct ratio prevents letterboxing (black bars on the sides), pillarboxing (black bars on the top and bottom), and distorted stretching that makes images look squashed or stretched.

This free online aspect ratio calculator lets you enter any width and height in pixels, instantly see the simplified ratio and its common name, and then scale those dimensions to any target size while keeping proportions locked. You also get the decimal ratio, total pixel count, megapixel count, and the diagonal pixel length — all the numbers you need when prepping assets for web, print, or video production.

How the Aspect Ratio Calculator Works

The calculator uses the Euclidean algorithm to find the Greatest Common Divisor (GCD) of the width and height you supply. Dividing both dimensions by their GCD produces the smallest whole-number ratio — what you see displayed as W:H. The decimal ratio is simply width divided by height and is used internally whenever you invoke the resize feature.

When you enter a target width (and have "Lock aspect ratio" checked), the calculator computes the matching height by dividing your target width by the decimal ratio and rounding to the nearest whole pixel. When you enter a target height instead, it multiplies that height by the decimal ratio and rounds. This guarantees the output dimensions are integer pixels that preserve your original proportions as closely as possible.

Additional statistics — total pixels (area), megapixels, and diagonal — give you a quick sense of file size and display scale. The diagonal is the Pythagorean distance across the rectangle: the square root of (width² + height²), expressed in the same pixel unit as the inputs.

Core Formulas

ratio = (W ÷ gcd(W,H)) : (H ÷ gcd(W,H)) | R = W / H | newH = round(targetW / R) | newW = round(targetH × R) | D = √(W² + H²) | MP = (W × H) / 1 000 000

Where:

  • W= Original width in pixels
  • H= Original height in pixels
  • gcd(W, H)= Greatest Common Divisor of W and H (Euclidean algorithm)
  • R= Decimal ratio (W ÷ H)
  • targetW= Desired new width in pixels
  • targetH= Desired new height in pixels
  • newH= Computed new height when scaling by target width
  • newW= Computed new width when scaling by target height
  • D= Pixel diagonal (Pythagorean distance across the rectangle)
  • MP= Megapixels (total pixels divided by one million)

Common Aspect Ratios and Their Uses

Understanding which ratio fits your use case saves rework. Here is a reference table of the most widely encountered aspect ratios, their standard pixel sizes, and where you typically see them:

Ratio Common Name Typical Resolutions Where Used
16:9 HD / Widescreen 1280×720, 1920×1080, 3840×2160 TVs, YouTube, Zoom, most monitors
4:3 Standard 800×600, 1024×768 Older monitors, presentations, iPad
1:1 Square 1080×1080, 2048×2048 Instagram posts, profile photos, print tiles
9:16 Portrait Video 1080×1920 TikTok, Instagram Stories, YouTube Shorts
21:9 Ultra-wide 2560×1080, 3440×1440 Gaming monitors, cinematic displays
3:2 Classic Photo 1500×1000, 3000×2000 DSLR cameras, 35mm film prints
2:1 Univisium 2000×1000 Netflix originals, wide banners

Clicking any preset in the calculator's Common Sizes panel loads those exact pixel dimensions instantly, so you can explore all ratios without typing anything manually.

Resizing Images and Videos Proportionally

One of the most practical features of this aspect ratio resize calculator is its ability to compute the missing dimension whenever you know only one side of the new size. This is critical when you have a source asset at one resolution — say a banner at 2400×600 — and a platform specifies only the maximum width of 1200 px. Instead of guessing, you enter 2400 and 600 as the source, type 1200 in the Target Width box, and the calculator immediately returns 300 as the proportional height. No algebra required.

The "Lock aspect ratio" checkbox controls whether the resize math runs at all. When it is checked (the default), entering either target dimension triggers the proportional calculation. When it is unchecked, no new dimensions are computed — useful if you just want the ratio stats without a resize preview.

Keep in mind that rounding to whole pixels can introduce a sub-pixel error of at most ±0.5 px. For most screen use cases this is imperceptible, but if you need pixel-perfect precision for print at high DPI you should verify the output with a dedicated image editor that supports fractional scaling.

Proportional resizing preserves the pixel density impression of the image. If you crop instead of scaling, the ratio changes; if you stretch non-proportionally, faces, circles, and text all appear distorted. Using this calculator before you export keeps everything looking exactly as intended.

Aspect Ratios in CSS and Web Development

Modern CSS has a native aspect-ratio property that accepts the same W / H notation you see in this calculator's output panel. For example, a container that should always be 16:9 regardless of viewport width is declared with aspect-ratio: 16 / 9;. This replaces older padding-top hack techniques (setting padding-top: 56.25% to fake a 16:9 box) and is now supported in all major browsers.

The calculator displays a ready-to-copy CSS snippet at the bottom of the results panel. You can paste it directly into a stylesheet. Combined with width: 100% and object-fit: cover on a child image or video element, this creates fully responsive media containers that never distort regardless of screen size.

When designing breakpoint layouts with a CSS grid generator or a breakpoint calculator, knowing the exact aspect ratio of your media blocks prevents content reflow surprises. Specify the ratio on the container element and let the browser do the arithmetic at each viewport width — far more reliable than hard-coding both dimensions at every breakpoint.

For <img> and <video> elements, including width and height HTML attributes (even when they are overridden by CSS) lets the browser reserve the correct space before the media loads, eliminating Cumulative Layout Shift (CLS) — a Core Web Vitals metric that affects SEO rankings.

Megapixels, Diagonal, and Total Pixels Explained

Beyond the simplified ratio, this calculator surfaces three supplementary statistics that are useful in different professional contexts.

Total pixels (area) is simply width × height. A 1920×1080 frame contains 2,073,600 pixels. This number matters when estimating memory usage, GPU buffer requirements, or texture atlas budgets in game development.

Megapixels divides the total pixel count by 1,000,000. The same 1920×1080 frame is therefore 2.07 MP. Camera manufacturers advertise sensor resolution in megapixels because it gives a quick sense of detail and maximum print size. A 12 MP camera can produce a sharp 16×20 inch print at 300 DPI; knowing the MP of an image you are working with helps you decide whether to upscale or crop.

Diagonal is the Pythagorean distance in pixels across the frame — the square root of (width² + height²). At 1920×1080 this equals approximately 2202.91 px. For physical screen sizing, manufacturers state the diagonal in inches; this calculator outputs in the same pixel unit you entered, which is most useful when you need to compare relative diagonal sizes of two different resolutions sharing the same ratio, or when setting SVG viewBox boundaries that must accommodate a diagonal stroke.

Worked Examples

Full HD to 720p — 16:9 Resize

Problem:

You have a 1920×1080 video and need to export a 720p version (width = 1280 px) at the same ratio.

Solution Steps:

  1. 1Enter width = 1920, height = 1080. The GCD is 120, so the simplified ratio is 16:9 (HD/Widescreen).
  2. 2The decimal ratio R = 1920 / 1080 = 1.7778.
  3. 3Enter target width = 1280. New height = round(1280 / 1.7778) = round(720.00) = 720.
  4. 4The calculator confirms new dimensions: 1280 × 720, which is standard 720p — same 16:9 ratio.

Result:

1280 × 720 (16:9, 0.92 MP)

Instagram Square Post — 1:1 Stats

Problem:

You want the stats for a 1080×1080 square image intended for an Instagram feed post.

Solution Steps:

  1. 1Enter width = 1080, height = 1080. GCD(1080, 1080) = 1080.
  2. 2Simplified ratio: 1080/1080 : 1080/1080 = 1:1 (Square).
  3. 3Decimal ratio R = 1080 / 1080 = 1.0000.
  4. 4Diagonal = √(1080² + 1080²) = √(2 × 1166400) = √2332800 ≈ 1527.28 px. Megapixels = 1080×1080 / 1 000 000 = 1.17 MP.

Result:

Ratio 1:1, 1527.28 px diagonal, 1.17 MP

Portrait Video (9:16) — Scale to Target Height

Problem:

You have a TikTok clip at 1080×1920 and need to scale it so the height is exactly 800 px.

Solution Steps:

  1. 1Enter width = 1080, height = 1920. GCD = 120; simplified ratio = 9:16 (Portrait Video).
  2. 2Decimal ratio R = 1080 / 1920 = 0.5625.
  3. 3Enter target height = 800. New width = round(800 × 0.5625) = round(450) = 450.
  4. 4Output dimensions: 450 × 800 — a perfectly proportional 9:16 portrait crop.

Result:

450 × 800 (9:16)

Custom Banner — Find the Ratio

Problem:

A designer produces a hero banner at 2400×600. What is its simplified aspect ratio?

Solution Steps:

  1. 1Enter width = 2400, height = 600.
  2. 2GCD(2400, 600): 2400 = 4 × 600 + 0, so GCD = 600.
  3. 3Simplified ratio: 2400/600 : 600/600 = 4:1. Not a named preset, so the calculator shows 'Custom'.
  4. 4Decimal ratio R = 2400 / 600 = 4.0000. Total pixels = 2400 × 600 = 1,440,000 = 1.44 MP.

Result:

4:1 (Custom), 1.44 MP

Tips & Best Practices

  • Use the Common Sizes panel to load standard presets like HD 1080p or 4K UHD instantly, then tweak from there.
  • Enter a target width OR a target height — not both at once — when using the resize feature; the second field clears automatically so proportions stay locked.
  • The CSS aspect-ratio snippet in the results panel is ready to paste; combine it with object-fit: cover on nested images for fully responsive media blocks.
  • For social media exports, match the platform's required ratio before cropping so you never lose important content at the edges.
  • The diagonal pixel value is useful when setting SVG viewBox dimensions or comparing two resolutions that share the same ratio.
  • Megapixels help you estimate whether a source image has enough resolution to print clearly — multiply the long edge in inches by 300 DPI to get the minimum pixel count needed.
  • A 9:16 portrait crop of a 16:9 landscape source loses 81% of the total pixel area; plan your composition accordingly if you need both orientations.
  • When uploading to a platform that hard-crops thumbnails (e.g., Twitter cards, OG images), confirm the exact ratio the platform enforces before you design the asset.

Frequently Asked Questions

Aspect ratio is the proportional relationship between a rectangle's width and height, written as two whole numbers separated by a colon (e.g., 16:9). It tells you how wide something is relative to its height without specifying actual pixel counts. Two images can share the same aspect ratio while having completely different resolutions, as long as both dimensions scale by the same factor.
Divide both the width and the height by their Greatest Common Divisor (GCD). For example, a 1920×1080 image has GCD = 120, giving 1920/120 = 16 and 1080/120 = 9, so the ratio is 16:9. This calculator performs that GCD step automatically using the Euclidean algorithm the moment you type your dimensions.
16:9 is a wider, landscape-oriented ratio that is standard for HD TVs, YouTube, and most modern monitors; it is approximately 1.78:1 in decimal form. 4:3 is squarer and was the standard for older televisions, CRT monitors, and early computer screens, with a decimal ratio of roughly 1.33:1. Content made for one ratio typically shows black bars (letterbox or pillarbox) if displayed on a screen of the other ratio without cropping.
Enter your original width and height, then type only one of the target dimensions — either the new width or the new height — with 'Lock aspect ratio' checked. The calculator computes the other dimension by dividing or multiplying by the decimal ratio and rounding to the nearest whole pixel. This ensures the resized image has exactly the same proportions as the original.
The calculator labels a ratio 'Custom' when it does not match any of the nine named presets it recognizes (16:9, 4:3, 1:1, 21:9, 3:2, 2:1, 9:16, 5:4, 3:1). The math is identical — the ratio is still fully simplified using GCD and displayed correctly — it simply has no common name in the preset list. Many real-world designs use custom ratios, such as 4:1 hero banners or 5:2 letterbox crops.
Proportional scaling rarely produces exact whole-number results, so the calculator rounds to the nearest integer using JavaScript's Math.round(). This rounding error is at most ±0.5 px and is invisible in practice for screen display. If you need sub-pixel accuracy for print prepress or compositing work, verify dimensions in a professional image editor after applying the ratio.
The CSS aspect-ratio property (e.g., aspect-ratio: 16 / 9) instructs the browser to maintain a fixed width-to-height ratio on a container element as the viewport changes size. This calculator displays a ready-to-copy CSS snippet in the results panel so you can paste the exact ratio declaration directly into your stylesheet without manual conversion.

Sources & References

Last updated: 2026-06-05

💡

Help us improve!

How would you rate the Aspect Ratio Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.