How to resize images to exact sizes and aspect ratios

Sooner or later every photo needs to fit a space: a form that asks for 800 by 600 pixels, a banner that must be 1,200 wide, a profile picture that has to be square. If you simply type in new numbers, the picture often ends up squashed or stretched, because the new shape does not match the old one. The fix is to understand aspect ratio, which is the relationship between width and height, and to choose between resizing, cropping or both. This guide explains the arithmetic with worked examples, shows how to resize without distortion, gives common sizes for web, social media and print, covers pixels versus centimetres and dpi, and lists the checks to make before you save.

Pixels and aspect ratio

A digital image is a grid of pixels. Its size is the width and height in pixels, for example 4000 by 3000. The aspect ratio is the width divided by the height, often written as two small numbers. 4000 by 3000 reduces to 4 to 3 by dividing both by 1000. Many phones and compact cameras produce 4 to 3 pictures, while many cameras and screens use 3 to 2 or 16 to 9.

To find the ratio, divide both numbers by their greatest common divisor. For 1920 by 1080, both divide by 120, giving 16 by 9. For 1200 by 630, both divide by 30, giving 40 by 21, which is about 1.9 to 1.

If you change the width and height by different proportions, the picture is distorted. A circle becomes an oval. Keeping the ratio the same when you resize prevents that.

Resizing without distortion

To resize and keep the shape, change one dimension and work out the other. New height = new width divided by the aspect ratio. For a 4000 by 3000 photo that needs to be 1200 pixels wide, the height is 1200 times 3000 divided by 4000, which is 900. So the result is 1200 by 900.

For 1920 by 1080 reduced to 800 wide, the height is 800 times 1080 divided by 1920, which is 450. So 800 by 450. If a form demands exactly 800 by 600, the picture's shape (16 to 9) does not match (4 to 3), and you must crop as well.

Most image tools have a 'keep proportions' or 'lock aspect ratio' option. Turn it on and type only one number. The tool fills in the other. Check that the result is a whole number of pixels, since images cannot have fractions of a pixel.

Cropping to fit a different shape

When the target shape differs from the original, you have to remove part of the picture. Crop first to the right aspect ratio, then resize. Decide what matters in the picture, such as a face or a product, and keep it inside the crop.

Worked example: a 4000 by 3000 photo that has to become 800 by 600 has the same 4 to 3 shape, so it only needs resizing. But if the same photo must become a 1200 by 630 share image, the target shape is 1.905 to 1 while the photo is 1.333 to 1. To crop, keep the full width of 4000 and cut the height to 4000 divided by 1.905, which is 2100 pixels. That removes 900 pixels of height, which you can take from the top, the bottom or both. Then resize the 4000 by 2100 crop to 1200 by 630.

For a square profile picture from the same photo, crop to 3000 by 3000, taking 500 pixels from each side, then resize to the target such as 400 by 400. A cropping tool with a fixed ratio lets you drag the frame over the best part.

Never enlarge a small image if you can avoid it

Making an image smaller discards pixels, and the result is usually sharp. Making it larger means the software has to invent pixels, and the picture looks soft and blocky. A 400 by 300 image stretched to 1600 by 1200 will not gain any detail.

If you need a larger version, go back to the original file, not a small copy that has already been resized. Phones often make a smaller copy for sharing. Ask for the original, or find the largest version available.

If you must enlarge, do it by a modest amount, and expect some loss. Some tools offer smarter enlargement, which can help a little, but it cannot recover detail that was never captured.

Common sizes

For the web, a content image displayed at 800 pixels wide is usually supplied at up to twice that, 1600 pixels, so it looks sharp on high-density screens. Full-width banners are often 1920 pixels wide. The share image for links is 1200 by 630.

For social media, a square post is often 1080 by 1080, a portrait post 1080 by 1350, and a story or short video 1080 by 1920, which is a 9 to 16 shape. Profile pictures are shown as circles or squares and are often 400 by 400 or more. These recommendations change, so check the current guidance for the service you use.

For UK passport photos, the printed photo is 45 mm high by 35 mm wide, and the digital photo rules require a minimum of 600 pixels wide by 750 pixels high, in colour, with a plain light background, a neutral expression and no shadows. Check GOV.UK for the current rules before you submit.

Pixels, centimetres and dpi

The printed size of a picture depends on its resolution in dots per inch (dpi). Pixels divided by dpi gives inches, and multiplying by 2.54 gives centimetres. A 3000 by 2000 pixel photo printed at 300 dpi is 10 by 6.67 inches, which is 25.4 by 16.9 cm. At 150 dpi it would print twice as large, 50.8 by 33.9 cm, but with lower sharpness.

A useful target for photo prints is 300 dpi. To print a 6 by 4 inch (15 by 10 cm) photo at 300 dpi you need 1800 by 1200 pixels. For a poster at A3 (29.7 by 42 cm, or 11.7 by 16.5 inches) at 150 dpi, you need 1755 by 2475 pixels.

The dpi number stored in a file has no effect on how it looks on screen. Only the pixel dimensions matter online.

Checks before you save

Check the final dimensions are exactly what the form or site asks for, and that the shape has not changed unintentionally. Zoom in to look at faces and text for blur. Choose the right format: JPG for photos, PNG for graphics with sharp edges or transparency.

Check the file size too. Many uploads have a limit, and a resized image is usually much smaller, but a high-quality setting may keep it large. Reduce the quality slightly if needed. Name the file clearly and keep the original untouched, saving the resized one as a new file.

If you have many images to prepare, decide on the sizes first, then process them in a batch for consistency. Consistent sizes make a site or a document look tidier.

Tools mentioned in this guide

Frequently asked questions

How do I resize an image without stretching it?

Lock the aspect ratio and change only the width or the height. The other follows. If the target shape is different, crop first and then resize.

How do I work out the height for a new width?

Multiply the new width by the old height and divide by the old width. For 4000 by 3000 resized to 1200 wide, the height is 900.

What is the aspect ratio of 1920 by 1080?

16 to 9. Divide both numbers by 120.

How many pixels do I need to print a 6 by 4 inch photo?

At 300 dpi you need 1800 by 1200 pixels.

Can I make a small image bigger without losing quality?

Not really. Enlarging makes the picture soft because there is no extra detail. Use the original, larger file where you can.