What Image Size Should You Use on a Website?
Three numbers get called "image size" and only two of them mean anything on a web page. Pixel dimensions are what the browser downloads and scales. File size is what your visitor waits for. DPI is a print instruction that has no effect on a screen at all, despite being the number most people are told to worry about.
Separating them makes the actual answer short, so this covers the distinction first, then the dimensions to use, then the file-size budgets worth aiming at.
Three numbers, two that matter
Pixel dimensions — 1920 × 1080, say — are the grid of pixels in the file. This is the number a browser cares about, and the one that drives everything else.
File size — 240 KB — is the bytes transferred. It follows from dimensions, format and compression quality together.
DPI or PPI — 72, 300 — is a print instruction: how many of those pixels to lay down per inch of paper. A browser ignores it completely. A 1000-pixel-wide image tagged 300 DPI and the same image tagged 72 DPI are byte-for-byte identical in every way that affects a web page, and display identically.
This is worth being firm about, because "save images at 72 DPI for web" is repeated everywhere and is a leftover from 1980s display conventions. It is not wrong so much as meaningless: changing the DPI tag alone does nothing. What people usually intend by it — "do not put a print-resolution monster on a web page" — is true, and the way to act on it is to change the pixel dimensions.
The rule that replaces all of it: export at the pixel dimensions the image will be displayed at, adjusted for screen density.
The dimensions to use
Start from the space the image occupies in your layout, then double it for high-density displays.
| Where it appears | Display width | Export width |
|---|---|---|
| Full-width hero | up to 1920px | 1920–2400px |
| Content column image | 600–800px | 1200–1600px |
| Half-width / two-up | 400–600px | 800–1200px |
| Card or listing thumbnail | 300–400px | 600–800px |
| Avatar or icon | 40–100px | 80–200px |
| Blog body image | 700px | 1400px |
Two adjustments to that table.
Do not double blindly. A 2× hero at 2400px wide is a large file, and the visible benefit on a phone is real but modest for a photograph. Doubling matters most for text, line art and interface screenshots, where softness is obvious, and least for continuous-tone photography.
Never upscale. Exporting a 600px image at 1200px invents pixels and produces a soft, larger file — worse on both counts. If the source is smaller than you need, the source is the constraint.
The compressor's longest-edge ladder maps onto this directly: 1920px for a hero, 1280px for most content images, 1080px for social, 800px for thumbnails. Set the longest edge and the aspect ratio is preserved, so portrait and landscape images in the same batch both come out sensibly.
High-density screens, without doubling everything
A phone with a device pixel ratio of 2 or 3 packs several physical pixels into each CSS pixel, so a 400px-wide slot can display 800 or 1200 real pixels. That is why an image exported at exactly its display width looks slightly soft on a modern phone.
Doubling every image is the crude fix and costs everyone the larger file. The proper fix is to offer several sizes and let the browser choose, which is what srcset is for — MDN describes it as providing "possible image sources for the user agent to use", with width descriptors like 400w and a sizes attribute telling the browser how wide the slot will be.
The practical division:
- You control the HTML — use
srcsetwith two or three widths. A phone takes the small one, a desktop with a high-density display takes the large one, and nobody downloads pixels they cannot show. - You upload to a CMS or a builder — most generate responsive variants themselves from your upload. Give them a generous source, around 2× the largest display size, and let the platform do the rest.
- You are hand-writing a single
imgtag — export at 2× the display width and accept the compromise. It is the right call for a small site.
Whichever route, always set the width and height attributes. MDN is explicit about why: including them lets "the aspect ratio of the image to be calculated by the browser prior to the image being loaded", reserving the space and "reducing or even preventing a layout shift". It costs nothing and prevents the page jumping as images arrive.
File size budgets
Dimensions decide how much data there is to compress; these are the targets worth compressing towards.
| Role | Target |
|---|---|
| Hero image | under 200 KB |
| Content image | 50–150 KB |
| Thumbnail | 10–40 KB |
| Icon or logo | under 10 KB, or SVG |
| Whole page, all images | under 1 MB |
They are not arbitrary. The reason to care about total page weight is that images are usually the largest thing on a page and frequently the element that Largest Contentful Paint measures — web.dev lists img elements among the element types LCP considers, and puts the threshold for a good score at 2.5 seconds or less, measured at the 75th percentile of page loads across mobile and desktop.
That percentile is the part people miss. You are not being judged on your own laptop on office wifi; you are being judged on the slower quarter of real visits. A 2 MB hero that loads instantly for you is exactly the file that fails the metric for someone on a phone with two bars of signal.
Reaching these targets is almost always a dimensions problem rather than a quality problem. A correctly sized 1200px image at 80% quality lands in the 50–150 KB band without effort; a 4000px image cannot, at any quality setting you would be willing to use.
Working out the number for your own layout
Guessing is unnecessary — the browser will tell you.
Open your page, right-click an image, choose Inspect, and read the element's dimensions. Browser developer tools show both the rendered size (the space it occupies) and the intrinsic size (the file's real pixels). When the intrinsic size is much larger than the rendered size, you have found waste, and the ratio tells you exactly how much: an image rendered at 800px from a 3200px file is carrying sixteen times the pixel data it can show.
Chrome and Firefox will also flag oversized images in a Lighthouse or performance audit, with the saving estimated in kilobytes, which is the least arguable way to prioritise a batch of them.
Then it is one pass through the resizer for a whole folder, or the compressor if you want dimensions and quality set together. The wider checklist covers the rest of what makes images fast — lazy loading, format, and which image must never be lazy-loaded.
Image Batch Resizer
Resize multiple images at once online for free. It runs in your browser, so the files never leave your machine, and there is nothing to install or sign up for.
Try the Image Batch ResizerFrequently asked questions
Do web images need to be 72 DPI?
No. DPI has no effect in a browser, which reads only pixel dimensions — the same image tagged 72 or 300 DPI displays identically. The advice is a print-era holdover. What matters is exporting at the pixel width you will display.
What is the best image size for a website in general?
There is no single answer because it depends on the slot, but 1920px wide covers full-width heroes and 1200px covers most content images, both at around 80% quality. The principle is constant: match the pixel dimensions to the display size, doubled for high-density screens.
Should I use 2x images for Retina screens?
Where sharpness is noticeable — text, screenshots, line art, logos — yes. For photographs the improvement is smaller and the file cost is real. The better answer if you control the HTML is srcset with two or three widths, so each device downloads only what it can display.
Is there a maximum file size for a web image?
No technical limit, but there are practical ones: aim under 200 KB for a hero and under 1 MB for all the images on a page combined. Beyond that you risk the Largest Contentful Paint threshold of 2.5 seconds at the 75th percentile of visits, which is where slower connections live.
What size should images be for social media?
Each platform publishes its own dimensions and they change often, so a preset is more reliable than a remembered number — the social media resizer keeps a current set. The general shape is 1080px on the long edge for feed posts and 1080 × 1920 for stories.
The short version
Forget DPI on the web; it does nothing. Export at the pixel width the image will display, doubled for high-density screens, and use srcset instead of doubling if you control the markup. Aim under 200 KB for a hero and under 1 MB per page, and always set width and height attributes so the layout does not jump. If an image is over budget, check its dimensions against its rendered size before touching the quality slider — that ratio is usually the whole problem.
Tools that go with this
Each one is here for a specific reason rather than because it is in the same category.
Image Compressor
Compress JPG, PNG, WebP by quality or target file size
Sets a longest-edge limit and a quality level in one pass, which is the usual way to hit a size target.
Image Cropper
Crop and resize images with custom aspect ratios
For when the aspect ratio is wrong rather than the resolution — cropping is not resizing.
Social Media Image Resizer
Resize one image to every social platform size at once
Platform dimensions are dictated rather than chosen, and this carries the current presets.
Image Format Converter
Convert between JPG, PNG, WebP, AVIF, and HEIC
The other half of the saving: correct dimensions in an efficient format.
Related articles
Image Optimization Best Practices
The nine things that actually make images fast, in order of impact — right dimensions, right format, lazy loading everything except the one image you must not.
How Image Compression Works
Why a photo can lose 80% of its bytes and look identical: what lossy compression discards, how quality settings behave, and why PNG ignores them entirely.
Why Your Image Is Still Too Large After Compressing
Six reasons compression did not shrink your file: a PNG that stayed a PNG, dimensions rather than quality, an already-optimised source, or a lying upload limit.
How to Compress an Image
Compress JPG, PNG or WebP files in your browser: which preset to use, when to set a target size in KB, and the order of operations that saves the most.
JPG vs PNG vs WebP: Which Should You Use?
A decision table plus the published figures: WebP is 25–34% smaller than JPEG and 26% smaller than PNG. When each format still wins, and where AVIF fits.
How to Compress Images Without Losing Quality
Truly lossless compression, and visually lossless compression, are different things. Which to use per image type, and where the quality thresholds actually sit.
What Is the Difference Between Lossy and Lossless Compression?
Lossless keeps every pixel; lossy discards what you cannot see. What each one actually promises, why lossless is not "better quality", and which to pick.
How to Open HEIC Files on Windows and Android
Windows and Android show a blank thumbnail instead of your iPhone photos. Here is the actual fix for each — usually a free codec, not new software.
Sources
- The <img> element
MDN Web Docs · Technical documentation · accessed 7 September 2026
Cited for: srcset and sizes providing candidate sources with width descriptors, and width/height letting the browser reserve space to prevent layout shift
- Largest Contentful Paint (LCP)
Google / web.dev · Official documentation · accessed 7 September 2026
Cited for: The 2.5-second threshold measured at the 75th percentile of page loads, and img elements being among the LCP candidate types
About the author
Builder and maintainer, ToolForge
Started ToolForge in May 2026 and has built and maintained it since, writing every tool on the site and the documentation that goes with each one.
Part of
Image Compression & FormatsWhy lossy compression works, which format to use, what image size a web page actually needs, and why a file is still too big after compressing it.
Browse all image tools