Image Cropper
Crop a precise rectangle from any image with numeric inputs — runs locally in your browser.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this image cropper
- Choose an image file from your device.
- Enter the crop region using X, Y (top-left origin), width, and height in pixels.
- Press "Crop Image" to render the cropped rectangle into a downloadable file.
- Preview the cropped output and click "Download" to save it locally.
- Adjust the numeric values and re-crop if the framing is not quite right.
About this image cropper
An image cropper extracts a rectangular region from a photo or graphic and discards everything outside that region. You define the rectangle with four numbers — X and Y for the top-left corner (measured in pixels from the top-left of the original), plus a width and a height — and the tool produces a new image containing only that slice.
Under the hood the tool decodes your file with the browser's native createImageBitmap API, then calls canvas drawImage with explicit source coordinates. This is the same primitive every professional image editor uses internally. The chosen region is drawn into a fresh off-screen canvas sized exactly to your width and height values, then re-encoded to a blob in the original file format. A JPEG in produces a JPEG out; a PNG in produces a PNG out. The whole operation runs without any network request — your file never leaves the browser.
For a concrete example: suppose you have a 3000 × 2000 px landscape photo and want a perfectly centred 1000 × 1000 px square for a profile picture. Set X = 1000, Y = 500, Width = 1000, Height = 1000. The tool draws that square from the middle of the image and gives you a 1000 × 1000 px download in under a second, ready to upload anywhere.
Numeric inputs are intentional rather than drag handles. Typing exact pixel values gives reproducible, pixel-perfect crops and avoids the continuous re-layout that pointer-move-based drag interfaces can trigger on large images.
FAQ
- Are my images uploaded anywhere?
- No, the cropper runs entirely in your browser. Your image is decoded, drawn to a local canvas, and re-encoded without any server round-trip.
- How do the coordinates work?
- The origin (0, 0) is the top-left corner of your image. X increases to the right and Y increases downward, so a crop at X = 100, Y = 50 starts 100 pixels from the left edge and 50 pixels down from the top.
- What happens if my crop extends past the image bounds?
- The tool refuses to run and shows an error. Cropping outside the bounds would produce blank pixels, so it is safer to ask you to correct the numbers.
- Why are there no drag handles?
- Drag-handle croppers cause continuous re-layout on pointer move, which can hurt INP scores on large images. Numeric inputs give pixel-precise control and stay fast on every device.
- Does cropping change the file format?
- No. The output uses the same MIME type as the input where possible, so a PNG in returns a PNG out, and a JPEG returns a JPEG.