‹ All guides

How to choose image dimensions for a website

An image that is too large slows the page; one that is too small looks blurry. The right size comes from the layout it sits in, not from the camera that took it.

Start from the layout

Check how wide the image actually appears on the page. A thumbnail shown at 300 pixels wide does not need a 4,000-pixel file, while a full-width hero image does need more. Match the export to the slot.

Cover high-density screens

Many phones and laptops show two physical pixels for every CSS pixel. Export at about twice the displayed width — a 600-pixel slot gets a 1,200-pixel file — so the image stays sharp on those screens.

One image, several sizes

When one image appears in several places, make a small, medium, and large version and let the page choose. Mobile visitors then download the small one, and the page stays fast for everyone.

Common widths for common slots

Most images on a website fall into a few sizes. A thumbnail is usually 300 to 400 pixels wide. A photo inside an article is usually 800 to 1,200 pixels wide. A full-width hero image at the top of a page is usually 1,600 to 2,400 pixels wide. A site logo is often 200 to 400 pixels wide. These are export widths, and they already include the extra pixels needed for sharp screens: a photo shown at 600 pixels wide is exported at 1,200. If your layout is different, measure the slot on the page and export to match it. A simple rule is to export at the display width for normal screens, and at twice the display width when you want the image to stay sharp on phones and laptops with high-density screens.

Why too big hurts

An image that is far larger than its slot wastes the visitor's time and data. A 4,000-pixel camera original can be 4 to 6 MB, and a page with five of them asks a phone on mobile data to download 25 MB before the page looks finished. Many visitors leave before that happens, and search engines notice when pages are slow. Large images also cost more to store and to serve, and they make backups bigger. The fix is not to delete the images, but to export a right-sized copy for the page and keep the original somewhere safe. A 1,200-pixel export of the same photo is often under 200 KB, which loads in a fraction of a second.

Why too small hurts

An image that is smaller than its slot has the opposite problem: the browser stretches it to fill the space, and the result looks soft and blurry. This is most visible on high-density screens, where one CSS pixel is shown with two or four physical pixels. A 600-pixel image in a 600-pixel slot looks fine on an older screen but soft on a modern phone. Exporting at twice the display width fixes it: a 1,200-pixel file in a 600-pixel slot has enough detail for the sharpest screens. The trade-off is file size, so do not go further than twice the display width. Four times the width adds very little visible sharpness and doubles or triples the file.

Responsive images in plain English

When one image appears in several places, or on both phones and desktops, make more than one version. A common set is small at 400 pixels wide, medium at 800, and large at 1,600. The page then sends the small version to a phone, the medium version to a tablet, and the large version to a desktop, so nobody downloads more than they need. Modern websites do this with a feature called responsive images, which lets the browser pick the right size automatically. Even without that feature, you can do it by hand: upload the small version where the slot is small, and the large version where the slot is large. The key idea is the same: match the file to the slot, and let small screens download small files.

A step-by-step sizing workflow

  1. Measure the slot. Open the page, find the image, and check how wide it appears in pixels. A browser's developer tools can show the exact size, or you can estimate from the layout.
  2. Double it for sharp screens. Multiply the display width by two. A 600-pixel slot needs a 1,200-pixel file; a 300-pixel thumbnail needs a 600-pixel file.
  3. Resize a copy of the original to that width, with the aspect ratio locked. Never resize the original itself, and never type both dimensions by hand.
  4. Compress the resized copy. Export as WebP or JPG at about 80% quality, and check the file size. A photo inside an article should usually be 100 to 200 KB.
  5. Check the result on a phone. Open the page on mobile data and look at the image. If it is sharp and the page loads quickly, the size is right.

Common mistakes to avoid

  • Uploading camera originals. A 4,000-pixel photo in a 600-pixel slot is ten times larger than it needs to be, and the page pays for every extra byte.
  • Using one size for every slot. The same file cannot be right for a thumbnail and a hero image. Make a version for each place the image appears.
  • Ignoring file size after resizing. A smaller image can still be heavy if it is saved as PNG or at 100% quality. Check the kilobytes, not just the pixels.
  • Forgetting high-density screens. An image exported at exactly the display width looks soft on modern phones. Export at twice the display width.

Related guides

How to resize photos without stretching →

How to prepare images for social media →

How to make a favicon for your website →

Frequently asked questions

What image size should I use for a website?

Match the slot: 300 to 400 pixels wide for a thumbnail, 800 to 1,200 for a photo inside an article, and 1,600 to 2,400 for a full-width hero image. Export at about twice the display width so the image stays sharp on high-density screens.

How do I know how wide my image displays?

Open the page in a browser, right-click the image, and choose Inspect. The developer tools show the displayed size in pixels. You can also measure the slot in your layout: if the content column is 700 pixels wide, a full-width image displays at about 700 pixels.

Does DPI matter for website images?

No, not for display. A browser shows an image by its pixel dimensions, and the DPI number in the file is ignored. DPI matters for printing: a 1,800-pixel image prints at 6 inches wide at 300 DPI. For the web, count pixels, not DPI.

Should I upload one image or several sizes?

Several, when the image appears in more than one place or on both phones and desktops. Make a small, a medium, and a large version, and let the page choose. Mobile visitors then download the small file, and the page stays fast for everyone.

Open the Image Resizer