A crop can match a requested aspect ratio exactly without changing the shape of individual pixels. This calculator finds the largest rectangle inside a source image whose whole-pixel dimensions have the target ratio. It also returns the coordinates of the rectangle's top-left corner. The position percentages determine where the crop sits within the available space, so you can move the frame toward a subject without changing its dimensions.
Enter the source dimensions and the desired ratio
Read the image width and height in pixels after accounting for the orientation used by your editor. A photo may be stored in landscape dimensions along with metadata that tells the viewer to display it vertically. Use the measurements for the orientation in which you will actually crop. Do not enter the size of the viewer window or the printed dimensions. The output is a rectangle designed to fit on the stated pixel grid.
The desired ratio uses two positive integers, such as 16 and 9 for a landscape frame. The calculator reduces them to their smallest equivalent pair before selecting a crop size. If you enter 1920 and 1080 as the ratio components, they reduce to 16 and 9. That entry sets the shape of the crop, not a fixed export resolution. If the resulting rectangle needs to be exported at 1920 by 1080, resize the finished crop separately afterward.
Worked crop from a 4032-by-3024 photo
Suppose the original is 4032 pixels wide and 3024 pixels tall. You want 16:9 and select a horizontal position of 50% and a vertical position of 35%. The largest whole multiple of the 16-by-9 unit that fits is 252, because 4032 divided by 16 is exactly 252 and the source height can accommodate more than 252 groups of nine. Multiplying gives a 4032-by-2268 crop.
The crop uses the full image width, so the x offset is zero regardless of the horizontal position input. It leaves 756 pixels of available vertical travel. At 35%, the top edge is 0.35 times 756 pixels from the top, rounded to the nearest pixel. The result gives y equal to 265. The rectangle starts at x zero and y 265, extends for 2268 rows, and leaves 491 rows below its bottom edge. A centered crop would instead remove 378 rows from both the top and bottom.
Understand the exact whole-pixel limit
To maintain the exact reduced ratio, the crop width and height must both be the same whole multiple of its two components. Divide the original width by the reduced ratio width, and divide the original height by the reduced ratio height. The smaller result limits the scale. Rounding it downward guarantees the requested rectangle remains inside the source. Increasing the multiple by one would require more width, height, or both than the source contains.
Some editors let a user choose an approximate crop where the resulting pixel ratio is slightly different because the dimensions are rounded independently. That can allow a few more pixels to remain. This calculator prioritizes an exact ratio and can remove pixels from two axes if the largest fitting multiple does not exactly use either dimension. If the reduced ratio components are already larger than the source on one axis, there is no positive whole-pixel multiple that will fit. A smaller source or a very unusual ratio can therefore produce a validation message.
Apply the coordinates in your editing tool
The x coordinate starts on the left edge of the displayed image, and the y coordinate starts at the top. Use the returned coordinates as a top-left origin together with the width and height. If an editor asks for the bottom-right boundary instead, add the width to x and the height to y for the edge coordinates. An inclusive last-pixel coordinate is one less than that edge. Check the convention used by the editor or image-processing library before copying the numbers directly.
The position slider percentage describes available offset. At zero, the crop hugs the leading edge on that axis. At 100%, it hugs the opposite edge. The middle uses half the available travel and removes almost equal amounts from each side, with a one-pixel difference possible when the surplus is odd. Review the final composition if a face or a text label sits near an edge, since the calculator knows only the dimensions and position values supplied.
Frequently asked questions
Does the tool open or modify my image?
Enter its dimensions manually. It returns crop numbers so you can apply the rectangle in your own editor.
Can I use it for a vertical version of the same ratio?
Swap the ratio components to request the vertical shape, such as 9:16. The calculator then finds the fitting rectangle for that orientation.
Why does my chosen horizontal position sometimes do nothing?
If the crop takes the full source width, there are no extra columns available on either side. Every horizontal position then produces x equal to zero.
Does cropping change the image resolution?
The cropped rectangle contains fewer pixels whenever rows or columns are removed. The pixels themselves are not resampled by the coordinate calculation.