How to Size Website Images for Desktop, Tablet, and Mobile

One of the easiest ways to make a website feel polished is to make sure its images fit the space in which they appear. A photo that looks crisp on a large desktop can look soft on a high-density phone, while a huge original image can waste mobile data even when it is displayed in a small card.

The solution is not to create a separate manually uploaded image for every device. It is to start with sensible dimensions, preserve the right proportions, compress the file, and let responsive image markup help the browser choose an appropriate source. This guide walks through a practical workflow for WordPress sites and other responsive websites.

1. Start with the space the image will occupy

Before resizing anything, inspect the layout. Is the image a full-width article banner, a two-column illustration, a square tool thumbnail, or a small avatar? The display slot—not the original camera dimensions—should guide the export size.

Estimate the maximum rendered width

Measure the widest content area in which the image will actually appear. If an article column is about 760 CSS pixels wide, a 5,000-pixel photograph is usually more than the layout needs. For a sharp result on high-density screens, you may export a source around 1.5–2 times the CSS display width, then let the browser select a smaller candidate on narrower screens. Treat this as a starting point, not a universal rule: theme layout, image detail, and device pixel density all matter.

For a quick one-off resize, use the ImagesPilot Image Resizer. If you need to trim empty space or change the composition, crop first with the Image Cropper.

2. Keep the aspect ratio unless the design calls for a crop

Resizing changes pixel dimensions; it should not accidentally stretch a subject. Keep the original aspect ratio when fitting an image into a flexible content area. If the design needs a fixed card shape, make an intentional crop instead of squeezing the image.

Common examples

  • Article hero: a wide landscape crop, often around 16:9, works well when the layout is wide.
  • Square card: use a deliberate 1:1 crop so cards align consistently.
  • Portrait image: keep a portrait ratio for people or product shots when vertical detail matters.

These are design examples, not mandatory dimensions. Check the actual container on desktop and mobile before exporting. A crop that looks balanced on a wide monitor may cut off the important subject on a phone.

3. Let responsive images serve different file sizes

A responsive page can offer multiple versions of the same image. The browser can then select a suitable candidate based on the available layout width and screen density. In HTML, this is commonly done with srcset and sizes.

<img
  src="photo-800.webp"
  srcset="
    photo-400.webp 400w,
    photo-800.webp 800w,
    photo-1200.webp 1200w"
  sizes="(max-width: 600px) 100vw, (max-width: 1000px) 80vw, 760px"
  width="1200"
  height="800"
  alt="A mountain lake surrounded by evergreen forest"
>

The width descriptors (such as 800w) tell the browser the intrinsic width of each candidate. The sizes value estimates how wide the image will be displayed at different viewport widths. The browser uses that information, along with its own knowledge of the device, to choose a resource.

Do not copy the example values blindly. Match the breakpoints and slot widths to your own layout. Also, avoid listing files under a width descriptor that does not match their real pixel width.

What WordPress already does

Modern WordPress core adds responsive image attributes to many images inserted through standard WordPress image functions and the block editor. When you upload a large image, WordPress normally creates several intermediate sizes and can include them in the generated srcset. This means most site owners do not need to hand-write srcset for every ordinary Image block.

Use the standard Image block or theme image functions where possible, and check the rendered page source if you suspect a theme or plugin is replacing the normal markup. WordPress cannot offer a useful smaller candidate if the required image sizes were never generated or if custom markup bypasses the responsive-image output.

4. Choose a suitable format, then compress

Dimensions and format work together. JPEG is still common for photographs, PNG is useful when you need lossless detail or transparency, and WebP is a practical modern option for many photographic and graphic images. The best choice depends on the image and on the browsers and workflows you need to support.

For a visual comparison of format trade-offs, read WebP vs PNG: Which Image Format Should You Use? and JPG vs PNG: Differences and Best Uses. You can convert a suitable source with the JPG to WebP or PNG to WebP tools.

After choosing the format, reduce unnecessary file weight while checking that fine edges, text, gradients, and textures still look acceptable. Use the ImagesPilot Image Compressor and compare the result at the size visitors will actually see. Our guide How to Compress Images for Faster Websites explains the compression stage in more detail.

5. Set intrinsic dimensions and avoid layout shifts

Include the image’s real width and height in the markup when your platform does not add them automatically. These attributes help the browser calculate the aspect ratio before the image finishes downloading, reserving space and reducing unexpected movement as the page loads.

Do not set a width and height that distort the image. CSS can make the image fluid while retaining its proportions:

img {
  max-width: 100%;
  height: auto;
}

If the image sits inside a fixed-ratio card, use a deliberate container and an appropriate crop rule such as object-fit: cover. Keep the image dimensions and the crop behavior consistent with the visual design.

6. Load images in the right order

Not every image should be treated the same way. Images far below the initial viewport can usually be lazy-loaded so the browser does not fetch them until they are near view. However, do not automatically lazy-load the main hero or another image that is likely to be the page’s Largest Contentful Paint (LCP) element. Delaying the most important visible image can make the page feel slower.

Use the platform’s native loading behavior where possible. If you manage HTML yourself, consider loading="lazy" for off-screen images and leave the key above-the-fold image eager. Test the page after changing loading behavior rather than adding the same attribute to every image.

7. A practical WordPress image workflow

  1. Choose the crop: decide whether the image is a banner, card, portrait, or illustration.
  2. Resize to the layout: export a sensible largest version rather than uploading an unnecessarily huge original.
  3. Pick the format: compare JPEG, PNG, and WebP based on transparency, image detail, and compatibility.
  4. Compress carefully: reduce file size and inspect the result at normal display size.
  5. Upload to the Media Library: let WordPress generate its intermediate sizes.
  6. Insert with a standard Image block: this helps WordPress output responsive image markup.
  7. Check the real page: view it at phone, tablet, and desktop widths, then inspect the image request and layout for problems.

If you need to rotate or flip a source before upload, use the Image Rotator or Image Flipper. For format conversion, see the full ImagesPilot image tools collection.

8. How to check whether the result is working

Test a representative article or landing page on a narrow phone viewport and a wide desktop viewport. Check that the subject remains visible, text does not overlap the image, and the browser is not downloading a much larger source than the layout requires. Browser developer tools can show the selected image request and its transfer size. A performance audit can also flag images that are larger than their rendered dimensions.

Remember that image work is one part of performance. Fonts, scripts, server response time, caching, and layout complexity also affect how quickly a page becomes usable. Optimized images help, but they are not a guarantee of a particular score or ranking.

Frequently asked questions

Should I upload separate images for desktop and mobile?

Usually not for ordinary images. A single source with responsive candidates is often enough. Use art direction—different crops for different screens—when the subject or composition genuinely needs to change at a breakpoint.

What width should a website image be?

There is no universal width. Start with the maximum rendered width of the content area, account for high-density displays, and provide smaller candidates for narrower layouts. Your theme and page design determine the useful sizes.

Does WordPress automatically make images responsive?

WordPress core supports responsive image markup and can add srcset and sizes to many standard image outputs. The exact candidates depend on the uploaded image, registered image sizes, theme, and how the image is inserted.

Should I lazy-load every image?

No. Lazy-loading is generally for images that start off-screen. The main visible hero image should not be delayed if it is important to the initial render.

Conclusion

Good website image sizing starts with the layout, not with an arbitrary pixel preset. Preserve the right proportions, create an intentional crop when needed, choose an efficient format, compress without visible damage, and let WordPress or your markup serve responsive candidates. Finish by checking the real page on multiple screen sizes. This repeatable workflow keeps images clear while avoiding unnecessary downloads for visitors on smaller screens.

Leave a Comment