How to resize images for a website

Photos straight from a phone are usually 4000 pixels wide or more, far bigger than any web page displays. Here’s how to pick sizes that stay sharp on high-resolution screens without slowing your pages down.

Published by the Lumekit team

Lumekit bulk processor resizing four images to a longest side of 1600 pixels and converting them to WebP
Preparing a set of website images in Lumekit’s bulk processor: longest side 1600 px, WebP, quality 82.

The rule of thumb: twice the displayed width

Measure the largest width, in CSS pixels, at which the image will appear on your page, then make the image about twice that width. High-density “retina” screens use two or more device pixels per CSS pixel, so a 2× image looks crisp there. Going beyond 2× rarely makes a visible difference but keeps adding bytes.

You can find the displayed width with your browser’s developer tools: inspect the image and read its rendered size. Use the widest layout you support (often the desktop view) for the calculation.

Practical sizes

Common starting points for typical layouts. Adjust to your own design and container widths.

ImageTypical display widthExport width
Full-width hero or banner1280–1440 px2000–2560 px
Image in an article column650–800 px1300–1600 px
Half-width or card image400–600 px800–1200 px
Thumbnail or avatar100–300 px200–600 px
Link preview (Open Graph)Shown by social sites1200 × 630 px

Resizing by the longest side is the easiest way to handle a mix of landscape and portrait photos: with a longest side of 1600 px, a landscape photo becomes 1600 px wide and a portrait photo 1600 px tall, and nothing is stretched.

Then compress and choose the format

Dimensions do most of the work, but format and quality finish the job:

  • WebP is a good default for the web: in our test the same 1200 × 800 photo was 84 KB as WebP and 102 KB as JPEG at the same quality setting. All current major browsers display it.
  • JPEG is the safest choice if images will also be downloaded or reused in other software.
  • PNG is for screenshots, logos and graphics with sharp edges or transparency, not for photos. The same photo as a lossless PNG was 0.99 MB.
  • A quality of about 75–85% is usually indistinguishable from the original at normal viewing size.

As a rough budget, aim for content images of about 100–200 KB and hero images under about 300–400 KB. Every page is different, but these keep most pages fast on mobile networks.

Our guide to JPG vs PNG vs WebP explains the format choice in more detail.

How to batch-resize images for a website

  1. Open the bulk processor and drop your images, or a whole folder.
  2. Tick Resize images, choose Longest side and enter a width from the table, for example 1600.
  3. Under Convert, choose WebP (or JPEG). Under Compress, keep quality around 80%.
  4. Optionally set a rename pattern such as site-{name}-{w}w so file names record the width.
  5. Press Process images and download the ZIP.

Everything happens in your browser, so even hundreds of large photos start processing immediately, with no upload.

Serve different sizes to different screens

If your site lets you write HTML, the srcset and sizes attributes let the browser pick the smallest file that still looks sharp. Export the same image at two or three widths, then:

<img
  src="team-1200.webp"
  srcset="team-800.webp 800w, team-1200.webp 1200w, team-1600.webp 1600w"
  sizes="(min-width: 900px) 800px, 100vw"
  width="1600" height="1067"
  alt="Our team at the 2025 workshop"
  loading="lazy">

Always include width and height so the browser reserves space and the page doesn’t jump as images load. Use loading="lazy" for images below the fold, but not for the main image at the top of the page.

If you use a CMS

Systems such as WordPress create several smaller copies of each upload automatically, and recent WordPress versions scale very large uploads down to 2560 px. Resizing before you upload still helps: uploads are faster, storage stays smaller, and you control the quality instead of leaving it to the CMS defaults.

Mistakes to avoid

  • Enlarging small images. Upscaling can’t add detail; it only makes files bigger and softer. Lumekit doesn’t enlarge unless you allow it.
  • Squashing to an exact size. Forcing a 4:3 photo into 16:9 distorts it. Keep the aspect ratio, or crop to the shape you need with the crop tool.
  • Re-compressing repeatedly. Keep your originals and always export from them, not from an already compressed copy.
  • Missing alt text. Describe what the image shows for people using screen readers. It also helps search engines understand the image.