How-to Guide 6 min read

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.

crop image to exact sizecrop image by pixelscrop image to aspect ratiocrop photo 1:1crop image 16:9

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

  • Open Crop Image and choose your photo. The tool shows its original size, for example "Original: 4000×3000px".
  • The four boxes start at X = 0, Y = 0 and the full width and height, so nothing is cropped yet.
  • Type your X, Y, Width and Height. The line under the boxes shows the output size, for example "Output: 3000×3000px".
  • Click Crop Image. A preview of the result appears.
  • Click Download. The file is saved as your original name plus _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:

  • Compare shapes. If the photo is wider than the target ratio, keep the full height and reduce the width. If it is taller, keep the full width and reduce the height.
  • Wider photo: crop height = image height, crop width = image height × ratio width ÷ ratio height.
  • Taller photo: crop width = image width, crop height = image width × ratio height ÷ ratio width.
  • Centre it: X = (image width − crop width) ÷ 2, Y = (image height − crop height) ÷ 2. Round to whole pixels.
  • 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 sizeTarget ratioXYWidthHeight
    4000 × 3000 (4:3 camera)1:1 square500030003000
    4000 × 300016:9037540002250
    4000 × 30004:5800024003000
    6000 × 4000 (3:2 camera)1:1 square1000040004000
    6000 × 40004:51400032004000
    3024 × 4032 (portrait phone)1:1 square050430243024
    3024 × 40324:5012630243780
    1080 × 1920 (phone screen)1:1 square042010801080
    1080 × 19204:5028510801350

    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:

  • Crop to the right shape using the table above (for example 3000 × 3000 from a 4000 × 3000 photo).
  • Resize to the exact size with Resize Image (for example 1080 × 1080).
  • 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.

    Try this tool on Lazyblink

    Put this guide into practice with our free online tool — no signup required.

    Open tool