ToolGrid — Product & Engineering
Leads product strategy, technical architecture, and implementation of the core platform that powers ToolGrid calculators.
AI Credits & Points are in development.
Learn moreLoading...
Preparing your workspace
Calculate aspect ratios for images and displays, convert between different ratio formats (16:9, 4:3, 21:9), resize images maintaining aspect ratio, displays common aspect ratios (cinema, photo, web), and shows pixel dimensions for screen resolutions.
Note: AI can make mistakes, so please double-check it.
Common questions about this tool
Paste your aspect ratio calculator code into the formatter, and it automatically applies proper indentation, spacing, and organization. The tool improves code readability while maintaining functionality.
Yes, the aspect ratio calculator beautifies code by adding consistent formatting, proper indentation, and organizing structure. This makes code easier to read, debug, and maintain without changing functionality.
No, formatting only changes whitespace and organization. It doesn't alter code logic, syntax, or behavior, so your aspect ratio calculator code works exactly the same after formatting.
Yes, the formatter offers customization options including indentation style, line length, and formatting preferences to match your project's coding standards and team preferences.
Paste minified code into the formatter, and it automatically adds proper indentation and line breaks to make the code readable again. This is useful for debugging or reviewing compressed code.
This tool calculates aspect ratio by taking the width and height you provide, simplifying them using a greatest common divisor, and displaying the result as a clean W:H pair like 16:9. It also shows the decimal ratio and whether the dimensions are landscape, portrait, or square. You can adjust either the pixel values or the ratio fields and the calculator updates instantly.
Use the Resize mode, enter your current width and height, and set the target ratio you want to maintain (or pick one of the presets like 16:9 or 4:5). When you change either width or height, the tool automatically recomputes the other side using the ratio so the proportions stay locked. You can then copy the new dimensions and apply them in your image editor.
To avoid distortion, you need to keep the same aspect ratio while changing size, which is exactly what this calculator does in Resize mode. Enter your starting dimensions, choose a target ratio (or keep the current one), and edit either width or height; the other value is recalculated so the ratio is preserved. The visual preview lets you compare the original and target shapes before you apply the numbers elsewhere.
In Convert mode, you can start from a ratio like 21:9 or 4:3 and let the tool generate concrete pixel dimensions. It uses a base width and applies the ratio to compute a matching height, then shows the resulting pair and simplified ratio. You can copy those dimensions or apply them back as the new source for further tweaking.
Switch to the Fit Box mode and enter the bounding box size (for example, your screen or container width and height) plus the content ratio you want to preserve. The calculator compares the box ratio to your target ratio and scales either width or height so the content fits fully inside without cropping or stretching, then shows the fitted dimensions and orientation. You can use those values when exporting or embedding your image or video.
Verified content & sources
This tool's content and its supporting explanations have been created and reviewed by subject-matter experts. Calculations and logic are based on established research sources.
Scope: interactive tool, explanatory content, and related articles.
ToolGrid — Product & Engineering
Leads product strategy, technical architecture, and implementation of the core platform that powers ToolGrid calculators.
ToolGrid — Research & Content
Conducts research, designs calculation methodologies, and produces explanatory content to ensure accurate, practical, and trustworthy tool outputs.
Based on 1 research source:
Learn what this tool does, when to use it, and how it fits into your workflow.
This aspect ratio calculator helps you work with width, height, and aspect ratio together. It works like a free online aspect ratio calculator where you enter dimensions in pixels and a target ratio, and the tool then gives you new dimensions that keep that ratio, fit inside a box, or turn a ratio into pixel sizes. You see the result as numbers and a small picture of the shape.
When you resize a picture or a video you often need to keep the same aspect ratio so it does not look stretched. Or you need to fit a layout into a given space. Doing the math by hand is slow and easy to get wrong, especially when you are trying to calculate aspect ratio from width and height online for specific formats like 16:9, 4:3, 1:1, or 9:16. This tool does the math for you and shows width, height, ratio, and whether the result is landscape, portrait, or square so you can resize images or videos while keeping aspect ratio.
The tool is for designers, developers, content creators, and anyone who works with images or screens and needs an image aspect ratio calculator online free. You can use it with little experience: you type numbers, pick a mode, and let the calculator resize or fit your content while keeping the same aspect ratio. The tool shows the result and you can copy the dimensions or use them as the new starting size when exporting assets or configuring responsive layouts.
The aspect ratio of a rectangle is the width divided by the height. We often write it as two numbers with a colon, like 16:9. That means for every 16 units of width there are 9 units of height. The same ratio can appear at many sizes: 1920×1080 and 1280×720 are both 16:9. A related operation involves calculating CIDR ranges as part of a similar workflow.
When you resize an image or video you usually want to keep the aspect ratio. If you change only the width, you must change the height in proportion. Otherwise the image looks squashed or stretched. The calculator does this: you give one dimension and the target ratio, and it gives you the other dimension.
Sometimes you have a maximum width and height, like a screen or a box. You want the content to fit inside that box but keep its ratio. The tool can compute the largest size that fits inside your box and still matches the ratio. That is the fit box mode.
Other times you only have a ratio, like 16:9, and you need concrete pixel sizes. You can set a base width and the tool gives you the height that matches the ratio. That is the convert mode. All three modes use the same inputs: width, height, and target ratio. The mode decides how they are combined. For adjacent tasks, calculating business days addresses a complementary step.
Resizing for a platform. You have an image at 1200×800 and need 16:9 for a video thumbnail. You enter 1200 and 800, set ratio 16:9, and use Resize. The tool gives you the new height (or width) so the image stays in proportion. You then resize the image in an editor using those numbers.
Fitting into a box. You have a space of 800×600 pixels and content that must stay 16:9. You enter 800 and 600 as dimensions, set 16:9, and use Fit Box. The tool gives you the largest 16:9 size that fits inside 800×600. You use that size so nothing is cropped and the ratio is kept.
Converting ratio to pixels. You need a 21:9 banner and want width 2100. You enter 2100 as width, set ratio 21:9, and use Convert. The tool gives you the height that matches 21:9. You use those dimensions when you create or export the asset. When working with related formats, calculating subnet masks can be a useful part of the process.
Checking orientation. You enter dimensions and a ratio and look at the result. The orientation label tells you if the result is landscape, portrait, or square. The preview shapes show the proportions. This helps you avoid using the wrong orientation for a layout or ad.
Chaining sizes. You get a result and click Apply. The result becomes the new source. You can then change the ratio or mode and get another size. Useful when you need several sizes from one source image.
In Resize mode the tool keeps the target ratio. If you last edited width, it computes height as width divided by (ratio width divided by ratio height). If you last edited height, it computes width as height times (ratio width divided by ratio height). So the result always has the same ratio as the target. The status is Ratio maintained. In some workflows, calculating pixels per inch is a relevant follow-up operation.
In Fit Box mode the tool has a box (your width and height) and a target ratio. It compares the box ratio to the target ratio. If the target is wider than the box, the result uses the full box width and a smaller height so the ratio is kept. If the target is taller than the box, the result uses the full box height and a smaller width. So the result fits inside the box and keeps the target ratio. The status is Fitted to box.
In Convert mode the tool uses your width as a base (or 1000 if width is zero). Result width is that base. Result height is base divided by (ratio width divided by ratio height). So you get one pair of pixel dimensions that match the ratio. The status is Converted.
The ratio shown in the result is simplified: the result width and height are divided by their greatest common divisor. For example 1920 and 1080 become 16:9. The decimal is result width divided by result height, rounded for display. Orientation is landscape if width is greater than height, portrait if height is greater, and square if they are equal. All values are capped so they do not exceed the maximum allowed dimension. For related processing needs, decoding JSON Web Tokens handles a complementary task.
| Preset | Ratio | Typical use |
|---|---|---|
| 16:9 | 16:9 | YouTube, widescreen |
| 9:16 | 9:16 | Stories, vertical video |
| 1:1 | 1:1 | Square |
| 4:5 | 4:5 | Portrait |
| 4:3 | 4:3 | Standard |
| 3:2 | 3:2 | Photo |
| 21:9 | 21:9 | Ultrawide |
| 2:3 | 2:3 | Poster |
These presets only set the target ratio. Width and height come from your inputs or from the result of the current mode.
In Resize mode the tool uses the dimension you edited last to compute the other. If you change width, height updates. If you change height, width updates. Make sure you have the right mode and ratio before you copy the result.
The tool does not upload or resize image files. It only calculates dimensions. You take the result width and height and use them in your image editor, video tool, or code to do the actual resize or crop.
Width, height, and ratio have maximum values. Very large numbers may be capped. For most screens and images the limits are enough. If you need huge dimensions check that the result is not clamped.
Fit Box always gives a size that fits inside your box. It may leave empty space on one side if your box ratio and target ratio differ. That is expected. The result is the largest size that fits and keeps the ratio.
The AI assistant is optional. It sends your text to a backend and may return a mode and dimensions. If it fails or returns nothing you can still use the calculator by entering numbers and choosing the mode yourself. The AI is a shortcut, not required.
When you copy the result you get width×height in pixels. Paste that into your workflow. When you apply the result as new source you can then try another ratio or mode on the same base size.
Articles and guides to get more from this tool
Have you ever tried to upload a photo to Instagram, only to have the edges chopped off? Or printed a beautiful vacation picture, but your fa…
Read full articleSummary: Calculate aspect ratios for images and displays, convert between different ratio formats (16:9, 4:3, 21:9), resize images maintaining aspect ratio, displays common aspect ratios (cinema, photo, web), and shows pixel dimensions for screen resolutions.