Skip to content
AgileLogics

Crop Image Online

Crops an image to a rectangle you specify by X/Y offset and width/height, using an in-browser canvas.

How it works

Choose an image, set the crop X, Y, width, and height, then click Convert.

How do I crop an image to exact pixel dimensions?

Decide where the top-left corner of the area you want sits (its X and Y position in pixels, measured from the image's top-left corner), then how wide and tall the area should be. Enter those four numbers here, choose your image and click Convert. The tool cuts out that rectangle and gives it back in the same format, JPEG for a JPEG and PNG for a PNG.

Precise numbers beat dragging a box when you need the same crop on several images, a crop that matches a required size such as 1080 × 1080, or a result you can describe to someone else exactly.

Steps

  1. Click Choose File and pick an image.
  2. Enter X offset and Y offset: how far from the left edge and from the top edge the crop starts. The defaults are 0 and 0, the top-left corner.
  3. Enter Width and Height of the area to keep. The defaults are 100 × 100.
  4. Click Convert, check the preview and click Download to save cropped.jpg or cropped.png.

All values are in the image's real pixels, not the size it appears in the preview. A 4000-pixel-wide photo shown small on screen still needs coordinates up to 4000.

Centering a crop: the formula

To cut a centered area of width w and height h from an image of width W and height H:

  • X = (W − w) ÷ 2
  • Y = (H − h) ÷ 2

Here is that applied to a 1920 × 1080 screenshot, keeping the full height and trimming the sides:

Target shape Width × Height X Y
Square, 1:1 1080 × 1080 420 0
4:5 portrait 864 × 1080 528 0
4:3 1440 × 1080 240 0
3:2 1620 × 1080 150 0
9:16 vertical 608 × 1080 656 0

The 9:16 width works out to 607.5, so it's rounded to 608. All four values must be whole numbers: there are no half pixels to cut along, so a value like 607.5 gets an error asking for a whole number.

How the tool treats unusual values

What you enter What happens
X or Y left blank Treated as 0
A negative X or Y "X offset must be 0 or more pixels."
Width or height of 0 or less "Width must be at least 1 pixel."
Width or height left blank "Enter a width in pixels."
Text that isn't a number, in any box "... must be a number of pixels, e.g. 100."
A decimal such as 10.5 "... must be a whole number of pixels."
Width or height that runs past the edge Trimmed to the edge, no error
X at or beyond the image width, or Y at or beyond the height "The crop area is outside the image bounds", followed by the image's actual size
No file chosen "Choose an image to crop."
A file the browser can't decode "Could not load image."

The trimming has a handy use. Set X to 300 and the width to something larger than the image, such as 99999, and you get everything from pixel 300 to the right-hand edge, without working out the remaining width yourself.

Finding the coordinates

Most image viewers show the pixel position under your cursor. On Windows, Paint shows it in the status bar, GIMP shows it in the bottom-left corner, and Photoshop has it in the Info panel. Hover over the top-left corner of what you want to keep, note X and Y, then hover over the bottom-right corner and subtract to get width and height.

If you only know the target size (say an avatar must be 400 × 400), it's often easier to crop to the right shape here and then scale with the image resizer. Cropping first and resizing second avoids distorting faces and logos.

Output format and file size

The result keeps the original format where the browser can write it. A JPEG photo is re-saved as a JPEG at 92% quality, which keeps the file small but, like any JPEG save, adds a little compression on top of the original's. A PNG stays a lossless PNG with its transparency intact. A WebP stays WebP in browsers that can encode WebP (Chrome, Edge, Firefox) and becomes PNG in those that can't. GIF, BMP, SVG and other formats come out as PNG. The download name follows the format: cropped.jpg, cropped.png or cropped.webp. To make a file smaller still, use the image compressor, or turn a cropped PNG screenshot into a JPEG with PNG to JPG.

Because the result is redrawn from canvas pixels, EXIF metadata such as camera model and GPS location doesn't come along. That's a useful side effect when you're cropping a phone photo before sharing it.

What it doesn't do

There's no rotation, no aspect-ratio lock, no drag handles and no batch mode. Each crop handles one image and one rectangle. Animated GIFs come out as a single still frame. For simple, exact rectangular cuts, though, typing four numbers is as fast as it gets.

Last updated

Frequently asked questions

Can I drag a box to choose the crop area?
No. This cropper works from numbers: you type the X and Y offset of the top-left corner and the width and height you want, all in pixels of the original image. That makes it precise and repeatable, but you need to know the coordinates first.
What happens if my width or height goes past the edge of the image?
The crop is trimmed at the image edge instead of failing. For example, X 1500 and width 1000 on a 2000-pixel-wide image gives a 500-pixel-wide result. You only get an error when X or Y itself starts outside the image, or when a value isn't a valid whole number.
What format is the cropped image?
The same as the original where possible. A JPEG comes back as a JPEG (cropped.jpg, re-saved at 92% quality), a WebP as a WebP in browsers that can write WebP, and everything else, including PNG and GIF, as a PNG (cropped.png), which keeps any transparency.
Is the image uploaded to crop it?
No. The image is decoded and cropped on a canvas in your browser, and the result is created on your device.