tooltulipA tool for everything
All toolsCategoriesSelectionsAbout
Tool index ↗
All tools
Image and video geometry

Aspect Ratio and Dimension Calculator

Find an exact width-to-height ratio, calculate a matching image size, or estimate the padding and crop for a target canvas.

Numbers stay in your browser and drafts are kept only in memory. Refreshing clears them. This tool does not upload or process images.

Dimensions to ratio

Each mode keeps its own draft. Results update locally as you edit; empty required fields remain an unfinished draft.

Positive base-10 whole numbers 1–1,000,000; surrounding whitespace is accepted. No zero, signs, decimals, exponents, grouping or trailing text. Resize also bounds the exact derived dimension; zero-pixel rounding is rejected. Fit values are continuous geometry, not rasterized output.

Exact source ratio

Enter the required dimensions or use an example to see the result.

≈ means the decimal display is approximate; its exact fraction is included. All arithmetic uses exact integers and fractions. The schematic alone uses screen-scale coordinates.

How to calculate an aspect ratio

  1. Choose Dimensions to ratio and enter the source width and height. The reduced ratio, decimal ratio and orientation appear immediately.
  2. Choose Resize proportionally to set either target width or target height. The other field is computed and read-only; review the exact ideal and nearest whole-pixel recommendation.
  3. Choose Fit into canvas to enter both canvas dimensions, then choose Contain/pad or Cover/crop. The diagram and summary show centered geometry.
  4. Copy the complete summary or download it as UTF-8 text. Reset all modes offers one-step Undo until another edit replaces the reset snapshot.

Worked examples

1920 × 1080 reduces exactly to 16:9; swapping gives 9:16. Resizing the landscape source to width 1280 produces 1280 × 720 without rounding. A square reduces to 1:1. A nearby source such as 1919 × 1080 remains 1919:1080, not an inferred 16:9.

A 4 × 3 source resized to width 101 has an ideal height of 303/4 = 75.75 pixels. The recommended height is 76, so the actual whole-pixel ratio is 101:76. That is explicitly different from the source's 4:3 ratio.

For a 400 × 200 source in a 300 × 300 canvas, Contain uses scale 3/4 and renders 300 × 150, leaving 75 pixels of padding at both top and bottom. Cover uses scale 3/2 and renders 600 × 300, cropping 150 pixels from each horizontal side. Both modes return a full 300 × 300 canvas, not just a resized image.

Exact arithmetic and rounding rules

Width and height are positive base-10 integers or ratio terms from 1 through 1,000,000. Surrounding whitespace is accepted; zero, signs, decimal values, exponent notation, grouped numbers and nonnumeric tails are rejected. Empty required fields stay neutral unfinished drafts. The original text is preserved on error.

BigInt greatest-common-divisor reduction and rational cross-products keep intermediate arithmetic exact. Decimal ratios show up to six places. An approximation marker and exact fraction accompany rounded displays; a small approximate zero is not an exact zero.

Proportional resize uses targetWidth × sourceHeight / sourceWidth, or targetHeight × sourceWidth / sourceHeight. Whole pixels round half-up, so 1.5 becomes 2. A counterpart that rounds to zero is an error, not silently clamped to 1. Both the ideal derived dimension and whole-pixel recommendation must remain within 1,000,000.

Contain, cover and enlargement

Contain scale is the smaller of canvasWidth/sourceWidth and canvasHeight/sourceHeight; Cover uses the larger. Rendered dimensions are source dimensions times scale. Centered per-side padding is (canvas − render)/2; centered crop is (render − canvas)/2. Fit displays use up to three decimals with approximation markers and exact fractions where needed.

These are continuous geometric estimates, including fractional sizes and distances. They do not predict a specific image library's integer rasterization or resampling. Intermediate Cover sizes can exceed the input limit without allocating image pixels; the diagram always stays bounded. An enlargement is allowed and explicitly labelled, but upscaling cannot add original image detail.

Presets, diagrams and limitations

1:1, 4:3, 3:2, 16:9 and 9:16 are geometry presets, not current social-platform upload specifications. Applying one replaces the source dimensions with the equivalent ratio pair, visibly disclosed. Select Custom and edit the source fields for any other ratio or actual size. Swap changes the source orientation; it does not swap the canvas.

The SVG schematic uses fixed screen bounds and text alternatives containing the original dimensions, ratio and output geometry. Solid and dashed outlines distinguish canvas and image without relying on color; extremely thin rectangles may be difficult to see, so the numeric summary is authoritative.

This calculator does not upload, crop, resize, rotate or encode images; it has no platform database or print-DPI assumptions. Copy/export is unavailable for partial or invalid drafts. Clipboard denial leaves a selectable complete summary for manual copying. Downloads contain calculations and assumptions, not timestamps or device details.

Apply your dimensions

Related tools

Image ResizerActually resize images using the dimensions you calculated.Image CropperCrop an actual image to a chosen aspect ratio.
Compare tools for this task:Image toolsMaths and number tools

How was this tool?

Help us improve Aspect ratio calculator.

Don't include sensitive data.

0/300

Opens your email app; you send it there. No email app? Copy your comment and email feedback@tooltulip.com.

tooltulip

Small tools. Big help.

All toolsFeatured toolsCategoriesAboutPrivacy
feedback@tooltulip.com Suggest a tool
© 2026 ToolTulip. All rights reserved.ToolTulip · An ongoing project

Optional analytics help us see which tools are used. No tool inputs are sent. Privacy