Everyday Life · Practical Life · Home & DIY
Aspect Ratio Calculator
Calculate the aspect ratio of any image, screen, or rectangle by entering width and height dimensions.
Calculator
Formula
W is the width and H is the height of the rectangle or image. gcd(W, H) is the greatest common divisor of W and H. Dividing both dimensions by their GCD reduces the ratio to its simplest whole-number form. The decimal ratio is simply W divided by H, giving a single number that describes the proportional relationship.
Source: Standard mathematical definition of ratio simplification using the Euclidean algorithm (Euclid, Elements, Book VII).
How it works
An aspect ratio describes the proportional relationship between the width and height of a rectangle. It does not specify the actual size of an object — only its shape. Two images can have the same aspect ratio but completely different resolutions. The ratio is expressed as W:H, where both numbers are reduced to their smallest whole-number equivalents using the greatest common divisor (GCD). For example, a 1920×1080 image and a 1280×720 image both share a 16:9 ratio because dividing each dimension by its GCD yields 16 and 9 respectively.
The calculation relies on the Euclidean algorithm to find the GCD of the width and height. Once the GCD is known, both the width and height are divided by it to produce the simplified ratio. A decimal ratio is also calculated by simply dividing width by height — this single number is useful for programmatic comparisons and determining whether a format is landscape (greater than 1.0), portrait (less than 1.0), or square (equal to 1.0). The scaled-height output shows how tall the rectangle would be if the width were normalized to 100 units, making cross-format comparison straightforward.
Aspect ratios are used across a vast range of practical contexts. In video production and broadcasting, the 16:9 widescreen standard is universal for HD and 4K content, while 4:3 remains common in legacy and educational media. Photographers work with ratios such as 3:2 (full-frame DSLR sensors), 4:3 (micro four-thirds cameras), and 1:1 (square format). Web developers specify responsive image containers using percentage-based padding tricks derived from the aspect ratio. Home cinema enthusiasts use aspect ratios to match projector output to screen dimensions, and architects use proportional relationships derived from aspect ratios in window and door design.
Worked example
Suppose you have a digital photograph with a resolution of 2400 × 1600 pixels and want to know its aspect ratio before uploading it to a website.
Step 1 — Find the GCD of 2400 and 1600: Using the Euclidean algorithm: gcd(2400, 1600) → gcd(1600, 800) → gcd(800, 0) = 800.
Step 2 — Divide each dimension by the GCD: Width part = 2400 ÷ 800 = 3. Height part = 1600 ÷ 800 = 2. The simplified aspect ratio is 3:2.
Step 3 — Calculate the decimal ratio: 2400 ÷ 1600 = 1.5000. Since 1.5 > 1, this is a landscape-oriented image.
Step 4 — Find the scaled height at width = 100: Height = (1600 ÷ 2400) × 100 = 66.67 units. This means for every 100 units of width, the image is 66.67 units tall — useful when setting responsive CSS containers.
This 3:2 ratio is the native ratio of most full-frame DSLR cameras and is also the standard for 35 mm film. Knowing this ratio allows the photographer to crop, resize, and export without distorting the image.
Limitations & notes
This calculator works only with rectangular shapes and cannot handle non-standard aspect ratios that involve irrational numbers (such as the golden ratio, approximately 1.618:1). Because the GCD algorithm requires integer inputs, very precise floating-point dimensions (e.g., sensor dimensions specified in millimetres with many decimal places) are rounded to the nearest whole number before processing, which may produce a slightly simplified ratio rather than the exact one. Additionally, the calculator expresses ratios in their most reduced form — so a 32:18 input will be reported as 16:9, which is mathematically identical but may differ from how a specific industry standard labels the format. Always verify the output against the specification of your target platform or device.
Frequently asked questions
What is the aspect ratio of a 1920×1080 resolution screen?
A 1920×1080 screen has an aspect ratio of 16:9. This is because the GCD of 1920 and 1080 is 120, and dividing both values by 120 gives 16 and 9 respectively. It is the universal standard for HD and Full HD televisions, monitors, and video content.
What is the difference between aspect ratio and resolution?
Resolution describes the total number of pixels in an image (e.g., 1920×1080), while aspect ratio describes only the shape — the proportional relationship between width and height. Two images with completely different resolutions, such as 1280×720 and 3840×2160, can share exactly the same 16:9 aspect ratio.
How do I maintain aspect ratio when resizing an image?
To maintain aspect ratio, multiply or divide both dimensions by the same scale factor. For example, if an image is 1200×800 (3:2 ratio) and you want a width of 600, divide by 2 to get a height of 400. Most image editing software has a 'constrain proportions' lock that does this automatically.
What aspect ratio should I use for YouTube videos?
YouTube recommends the 16:9 aspect ratio for all uploaded videos. The ideal resolution for standard HD is 1920×1080, and for 4K it is 3840×2160. Both share the 16:9 ratio. Videos uploaded in other ratios will have black bars added (letterboxing or pillarboxing) to fill the 16:9 player frame.
How do I find the aspect ratio for a custom frame or canvas size?
Enter your frame's width and height into the calculator — the unit doesn't matter as long as both use the same unit (inches, centimetres, millimetres, etc.). The calculator will find the GCD and return the simplified ratio. For example, a 24-inch by 16-inch canvas returns a 3:2 ratio, matching standard photographic print proportions.
Last updated: 2025-01-15 · Formula verified against primary sources.