Home / Image guides / Guide: how to crop an image

How to Crop an Image

Ways to crop a picture on every device, with the aspect ratio maths, tips for keeping quality, and commands for the terminal and code.

The short answer

The fastest way is the online image cropper: open the picture, drag the box over the part to keep, and download the result. For work you do often, every operating system and office program also has a crop tool. Menu names change between versions, so look for Crop or Edit if something has moved.

WhereHow
OnlineImage cropper
WindowsPhotos: Edit image, Crop. Paint: Select, then Crop
MacPreview: Tools, Rectangular Selection, then Tools, Crop
iPhone and iPadPhotos: Edit, Crop
AndroidGoogle Photos: Edit, Crop
Word, PowerPointSelect the picture, Picture Format, Crop
Command lineImageMagick, ffmpeg or jpegtran

Windows

Open the picture in the Photos app, choose Edit image, then Crop. Drag the corners or pick an aspect ratio, then save a copy. In Paint, use Select to draw a rectangle around the part to keep, then choose Crop. Save with a new name so that the original stays untouched.

Mac

Open the picture in Preview. Choose Tools, then Rectangular Selection, drag over the part to keep, and choose Tools, then Crop (Command+K). Use File, Export to save a copy.

iPhone, iPad and Android

Open the photo, tap Edit, then the crop tool. Drag the corners, or choose an aspect ratio such as square or 16:9, and save. On the iPhone the edit can be reverted later. Android phones use Google Photos or the gallery app in much the same way.

Word and PowerPoint

Select the picture, choose Picture Format, then Crop. The cropped part is hidden, not deleted, so you can crop again later. To remove the hidden parts and make the file smaller, use Compress Pictures and keep Delete cropped areas of pictures switched on.

Command line and code

# ImageMagick: width x height + left + top
magick input.jpg -crop 800x600+100+50 +repage output.jpg

# ffmpeg: width:height:left:top
ffmpeg -i input.jpg -vf "crop=800:600:100:50" output.jpg

# Lossless JPEG crop (offsets snap to the JPEG block grid)
jpegtran -crop 800x600+96+48 -copy all input.jpg > output.jpg
# Python with Pillow: left, upper, right, lower
from PIL import Image
Image.open("input.jpg").crop((100, 50, 900, 650)).save("output.jpg")

// JavaScript canvas: source x, y, width, height, then the destination
ctx.drawImage(img, 100, 50, 800, 600, 0, 0, 800, 600);

Aspect ratio maths

To crop to a ratio, keep one side and work out the other. For a ratio of W:H, the height of the box is its width x H / W, and its width is its height x W / H.

RatioWidth to heightExample
1:1height = width1000 x 1000
4:3height = width x 0.751200 x 900
3:2height = width x 0.6671500 x 1000
16:9height = width x 0.56251920 x 1080
4:5height = width x 1.251080 x 1350
9:16height = width x 1.7781080 x 1920

Ready-made pages: 1:1, 4:3, 16:9 and Instagram.

Crop without losing quality

  • Crop from the original file, not from a copy that was already cropped or compressed.
  • PNG is lossless, so a PNG crop keeps every kept pixel exactly.
  • JPG and WebP are saved again, so use a quality of 90 or higher, and avoid cropping the same file many times.
  • Do not enlarge a small crop. Making it bigger only blurs it.

Crop, resize and compress

Crop cuts away parts of the picture. Resize changes the pixel size of the whole picture. Compress lowers the file size without changing the pixels you see. A common order is to crop first, then resize, then compress.

Composition tips

The thirds lines on the crop box divide the picture into nine parts. Place the subject on a line or an intersection instead of the centre, leave room in the direction the subject faces, and cut away distractions near the edges.

Related tools

Crop with the image cropper, or open a ready-made page for JPG, PNG, WebP, squares and passport photos. Convert with JPG to WebP and read the JPG vs WebP guide.

Crop your image now. Drag the box, choose a ratio or exact pixels, and download. Free, in your browser.

Open the image cropper

Frequently asked questions

How do I crop a picture on Windows?

Open it in the Photos app, choose Edit image, then Crop, drag the corners and save a copy. In Paint, select an area and choose Crop.

How do I crop a photo on a Mac?

Open it in Preview, choose Tools, Rectangular Selection, drag over the part to keep, then choose Tools, Crop.

How do I crop a picture to a certain size?

Use a tool that accepts pixels, such as the online image cropper, and type the size, or crop to a ratio and then resize.

What is the difference between cropping and resizing?

Cropping removes parts of the picture. Resizing changes the pixel size of the whole picture and keeps everything in it.