How to Crop an Image to an Exact Pixel Size or Aspect Ratio
Work out the X, Y, width and height to crop a photo to 1:1, 16:9 or 4:5, centre the crop, and avoid black edges. With a worked table for common sizes.
The short answer
To crop an image to an exact size, you need four numbers: X and Y (the top-left corner of the crop) and width and height (the size of the crop) in pixels. Type them into the Crop Image tool and it cuts out exactly that rectangle. To centre a crop, use X = (image width − crop width) ÷ 2 and Y = (image height − crop height) ÷ 2. The table below has ready-made numbers for common photo sizes.
How pixel cropping works
Every image is a grid. Position (0, 0) is the top-left corner. X counts pixels to the right, Y counts pixels downwards.
- X: how many pixels to skip from the left edge.
- Y: how many pixels to skip from the top edge.
- Width: how many pixels wide the result should be.
- Height: how many pixels tall the result should be.
So X = 500, Y = 0, width = 3000, height = 3000 on a 4000 × 3000 photo means: skip 500 pixels from the left, start at the top, and keep a 3000 × 3000 square. That is a centred square crop, because 500 pixels are removed from each side (500 + 3000 + 500 = 4000).
Step by step in the Crop Image tool
_cropped.jpg.The crop is done on a canvas in your browser, so the photo is not uploaded.
Working out a crop for any aspect ratio
An aspect ratio is width : height. To crop the largest possible area at a given ratio:
Example: a 1080 × 1920 phone screenshot cropped to 4:5. The photo is taller than 4:5, so keep the width: crop height = 1080 × 5 ÷ 4 = 1350. Then Y = (1920 − 1350) ÷ 2 = 285. Enter X = 0, Y = 285, Width = 1080, Height = 1350.
Ready-made centred crops
These values were calculated with the formulas above. Use them directly, or shift X or Y to move the crop towards the subject.
| Original size | Target ratio | X | Y | Width | Height |
|---|---|---|---|---|---|
| 4000 × 3000 (4:3 camera) | 1:1 square | 500 | 0 | 3000 | 3000 |
| 4000 × 3000 | 16:9 | 0 | 375 | 4000 | 2250 |
| 4000 × 3000 | 4:5 | 800 | 0 | 2400 | 3000 |
| 6000 × 4000 (3:2 camera) | 1:1 square | 1000 | 0 | 4000 | 4000 |
| 6000 × 4000 | 4:5 | 1400 | 0 | 3200 | 4000 |
| 3024 × 4032 (portrait phone) | 1:1 square | 0 | 504 | 3024 | 3024 |
| 3024 × 4032 | 4:5 | 0 | 126 | 3024 | 3780 |
| 1080 × 1920 (phone screen) | 1:1 square | 0 | 420 | 1080 | 1080 |
| 1080 × 1920 | 4:5 | 0 | 285 | 1080 | 1350 |
Cropping to an exact final size, such as 1080 × 1080
Cropping only removes pixels; it does not scale. If you need a final size that is smaller than your crop, do it in two steps:
Doing it in this order keeps the photo undistorted. If you resize first to a size with different proportions, faces and circles get stretched.
If your crop is already the exact size you need, for example cutting a 1080 × 1080 area out of a larger photo at full resolution, one step is enough.
Moving the crop off-centre
Centred crops are a starting point. To keep a person's face in a portrait crop of a landscape photo, find roughly where the face is horizontally and move X towards it. Keep within the limits:
- X must be between 0 and image width − crop width.
- Y must be between 0 and image height − crop height.
Avoiding black edges and other surprises
Black strips on the right or bottom. If X + width is bigger than the image width (or Y + height is bigger than the image height), the crop extends past the photo. The empty part has no pixels and comes out black in the JPG. Check the arithmetic before clicking Crop.
Transparent PNG turns black. The tool always saves a JPG, and JPG cannot store transparency. In our Chrome test, the transparent corners of a cropped PNG logo became solid black. For logos and graphics with transparency, crop a copy that has a solid background, or put the result on a background afterwards.
Lower quality than expected. The output is a JPG saved at high quality (0.92 on the browser's 0 to 1 scale), which is good for photos but adds slight artefacts around sharp text. For screenshots that need crisp text, keep the crop as large as possible so artefacts are less noticeable.
Rotated phone photos. If the preview looks sideways, rotate the photo first with Rotate Image so your X and Y numbers match what you see.
Common sizes people crop to
- Square profile pictures and product photos: 1:1.
- Portrait social media posts: 4:5.
- Video thumbnails and presentation slides: 16:9.
- Document photos (passport, visa, exam forms): these need specific sizes and backgrounds, so use the dedicated Passport Photo Maker instead.
For free-form cropping tips such as square and circle crops, see how to crop an image online.
Frequently asked questions
How do I crop an image to an exact pixel size?
Enter X, Y, width and height in pixels in the Crop Image tool. X and Y are the top-left corner of the crop, measured from the image's top-left corner. Width and height are the size of the result.
How do I centre a crop?
Set X = (image width - crop width) / 2 and Y = (image height - crop height) / 2. For example, a 3000 x 3000 square from a 4000 x 3000 photo uses X = 500 and Y = 0.
Why does my cropped image have a black edge?
The crop goes past the edge of the photo. Make sure X + width is not more than the image width and Y + height is not more than the image height.
Does the crop tool keep PNG transparency?
No. The result is always saved as a JPG, which has no transparency, so transparent areas come out black. Crop a version with a solid background instead.
Put this guide into practice with our free online tool — no signup required.
Open tool