Does DPI matter for web images? No. DPI (Dots Per Inch) is a metadata tag meant for physical printing, and browsers ignore it completely when rendering a page. What actually controls your web image's file size and sharpness is its pixel dimensions combined with how efficiently it is compressed. Changing a file from 300 DPI to 72 DPI will not shrink it by a single byte.
Why is DPI ignored by web browsers?
A browser renders an image by reading its pixel grid and placing it into the layout according to CSS rules. It has no concept of inches, so the DPI tag embedded in a file's metadata is simply never consulted during rendering. This is documented behavior, not a quirk of one browser: the determination of how an image displays is based on its intrinsic pixel dimensions, not any DPI value stored alongside it.
This matters because many editors still ship with a default 'change DPI to 72 for web' workflow left over from early desktop publishing advice. On the web, that step changes nothing about load time, sharpness, or file size. It only affects how a print application might scale the image for a physical page.
What is the difference between pixel dimensions and DPI?
Pixels are the actual data points that make up an image. An image that is 1000 pixels wide contains 1000 columns of color information, each stored and compressed. DPI or PPI (Pixels Per Inch) is an instruction for a printer or layout application on how far apart to space those same pixels on a physical page. The pixels do not change; only the intended physical scale does.
| Property | Impact on web | Impact on print |
|---|---|---|
| Pixel dimensions | Determines display size and file size | Determines physical print size |
| DPI/PPI metadata | Ignored by browsers | Sets the physical print scale |
| Compression | Primary driver of file size | Affects print quality, not physical size |
Illustrative example: changing DPI changes nothing
This is a worked, illustrative example, not a measured test. Imagine a 2000x2000 pixel JPEG. If you open it in an editor and change the metadata from 300 DPI to 72 DPI without resizing, the file size stays the same because the pixel count and compression are untouched. The browser still only reads 2000x2000 pixels and the quality setting applied to them. To actually reduce the file, you need to change the pixel dimensions, the compression, or both.
How do I calculate the correct pixel dimensions for my layout?
Start from the display slot, not the source file. If a layout column is 600 CSS pixels wide, an image exported at 3000 pixels wide is wasted data; the browser downloads the full file and only then scales it down on the visitor's device. Resizing changes the actual pixel count, while compression separately reduces the byte size of those same pixels through more efficient encoding. Both steps matter and they are not interchangeable.
A practical approach is to resize to the display slot dimensions with some headroom for sharper screens, rather than relying on any DPI setting, which has no bearing on the result at all.
Why do high-density screens require specific image strategies?
Many phones and laptops have a device pixel ratio (DPR) greater than 1, meaning one CSS pixel is rendered using multiple physical screen pixels. A 500px CSS container may need a 1000px or 1500px source image to look sharp on these displays, even though the layout width never changes. This has nothing to do with DPI metadata; it is a separate, real factor that does affect how many pixels you need to supply.
The standard way to handle this is the srcset attribute, which lets you offer several image sources so the browser can pick the best match for the viewer's screen density and viewport size, instead of you guessing a single fixed size for every visitor.
What is the correct workflow for optimizing web images?
Ignore DPI entirely and focus on two controllable factors instead.
- →Resize to the display dimensions: match the pixel width to the layout slot, with extra pixels only for known high-DPR targets.
- →Optimize compression: adjust JPEG, WebP or AVIF quality settings to balance visual fidelity against byte count. Remember JPEG is lossy even at high quality, and a 'visually lossless' result is not pixel-identical to the original.
- →Serve responsive variants: use srcset and sizes so different devices receive an appropriately sized file rather than one oversized master image.
- →Check format support before switching: a browser that can display AVIF is not guaranteed to be able to encode it, so test the actual export, not just playback.
If you process images locally in a browser-based tool, be aware that raster re-encoding (JPEG, PNG, WebP, AVIF) typically drops embedded metadata such as ICC color profiles or GPS tags, while SVG or pass-through files may retain it. Also, SVG minification that only strips comments and whitespace is not the same as full SVG optimization, and GIF processing that reads only the first frame is not an animation or video export.
How can I verify my image performance?
After resizing and compressing, check the actual output rather than trusting the editor's settings dialog. Inspect the file's dimensions and size in your file manager, or open browser developer tools and look at the Network panel to see the real bytes transferred for that image on the live page.
Smaller image bytes can help Largest Contentful Paint (LCP) because the browser has less data to download and decode, but they do not directly improve Time to First Byte and they do not guarantee any ranking outcome. Cumulative Layout Shift (CLS) is a separate concern: it requires reserved layout space for the image, not just a smaller file. Also avoid lazy-loading whichever image is your LCP candidate, since that delays its load and can hurt the very metric you are trying to improve.
Limitations to keep in mind
Re-compressing an already optimized file can sometimes increase its size rather than reduce it, so always compare before and after. Different browsers decode and encode images with varying efficiency, so a result on one device is not guaranteed on another. None of this is about DPI at all; the DPI tag remains irrelevant to every step described above.