Does DPI matter for web images? 72 vs 300 DPI, tested in Chrome

· Heart Photos

A bright modern living room with gray sofas and tall windows onto a pool and palm trees
A bright modern living room with gray sofas and tall windows onto a pool and palm trees · Made by AI

No. For an image on a web page, the DPI setting does not matter: a browser draws it by its pixel dimensions and ignores the DPI tag. We saved one image twice, tagged 72 DPI and 300 DPI: the two files were the same size to the byte, held the same pixels, and Chrome showed both at the same size. What matters on the web is how many pixels the image has. DPI matters when you print, and there is one rare exception in browsers, covered below.

What is the DPI of an image file?

It is a note stored in the file beside the pixels, saying how many of them should go into each inch when the image is printed. It is not a property of the pixels themselves. An image that is 3,000 pixels wide and tagged 300 prints 10 inches wide; change the tag to 72 and the same pixels would print almost 42 inches wide. Nothing else about the file changes.

Adobe's Photoshop help says the same of printed image resolution (updated Feb 23, 2026): dimensions are the pixel count, and resolution is how densely those pixels are packed on paper.

Strictly, pixels per inch (PPI) describes an image and dots per inch (DPI) describes a printer's ink dots. In everyday use, and in most export dialogs, people say DPI for both, so this post does too.

Does changing the DPI change the file?

Only the note. On Nov 10, 2026 we took the image at the top of this post at 1,920 by 1,227 pixels and saved it as a JPEG at quality 85 with Pillow 12.1.1, once with dpi=(72, 72) and once with dpi=(300, 300).

Tagged 72 DPI Tagged 300 DPI
Pixel dimensions 1,920 x 1,227 1,920 x 1,227
File size 327,563 bytes 327,563 bytes
Decoded pixels Identical Identical
Bytes that differ 4, in the file's header 4, in the file's header

The four bytes are the two density numbers in the JPEG's header. Every byte of image data is the same.

A file only gets smaller or larger when the app also resamples it, which means changing the number of pixels. Many export dialogs do both at once, which is where the idea that "72 DPI makes a smaller file" comes from. Adobe's page says the same: the image data stays constant unless the image is resampled.

Does a browser read the DPI tag?

Almost never. We made six small JPEGs of 400 by 200 pixels, each with a different resolution tag, and asked Chrome 156 on Windows for the size it gives each one (naturalWidth and naturalHeight).

Tag in the file Size Chrome gave it
JPEG header says 72 DPI 400 x 200
JPEG header says 300 DPI 400 x 200
EXIF says 300 DPI, EXIF dimensions 400 x 200 400 x 200
EXIF says 144 DPI, EXIF dimensions 400 x 200 400 x 200
EXIF says 144 DPI, EXIF dimensions 200 x 100 200 x 100
EXIF says 300 DPI, EXIF dimensions 96 x 48 96 x 48

The first four rows are what an ordinary export produces, and the tag changed nothing. The last two rows are the exception.

When does a browser use the resolution in a file?

When the file says the same thing twice. The HTML standard tells browsers to use an image's EXIF resolution only if the EXIF tags PixelXDimension and PixelYDimension are also present, the unit is inches, and the numbers agree: the real width times 72, divided by the resolution, must equal the EXIF width, and likewise for the height. In the standard's words, "72 is the base for computing size from resolution."

In our fifth file, 400 x 72 / 144 = 200, which matches the EXIF width of 200, so Chrome treats it as a 200 by 100 image with twice the detail. That is useful for a high-density image that should lay itself out at half its pixel size without any markup.

An ordinary file fails the check. A camera or an editor writes the real pixel count into those EXIF fields, so a 400 pixel wide image tagged 300 would need an EXIF width of 96 to qualify, and it says 400. The check exists so that existing images keep their size.

Firefox has done the same since version 90, according to its bug report. WebKit's report, for Safari, was still open when we looked on Nov 10, 2026. We tested only Chrome ourselves.

Where does "72 DPI for the web" come from?

It is a habit carried over from older screens and software, and many export dialogs still offer it. Whatever its origin, screens do not share one density, and as the test above shows, browsers do not ask the file. CSS has its own fixed scale: one CSS inch is 96 CSS pixels, whatever any image's tag says, and on a high-density screen one CSS pixel covers several device pixels.

So a web image is sized by pixels in two steps: how many pixels the file has, and how many CSS pixels wide your page shows it. Adobe's page on image size on screen lists the same two factors: the image's pixel dimensions and the monitor's size and resolution.

What should you set instead of DPI for the web?

  • Enough pixels for the slot. An image shown 800 CSS pixels wide needs about 1,600 pixels for a screen with two device pixels per CSS pixel. What size images should be for a website works through the arithmetic and srcset.
  • No more pixels than that. Extra pixels are what slow a page down, not a high DPI tag.
  • A sensible format and quality. See what JPEG quality to use and AVIF vs JPEG XL vs WebP.
  • Width and height in the markup, so the page does not jump while the image loads:
<img src="room-800.jpg"
     srcset="room-800.jpg 1x, room-1600.jpg 2x"
     width="800" height="511"
     alt="A living room with tall windows onto a pool">

Leave the DPI field at whatever your app suggests.

When does DPI matter?

When the image goes on paper. Adobe describes 300 pixels per inch as the industry standard for high-quality prints (page updated Feb 23, 2026) and notes that large prints seen from a distance, such as billboards, work at less. The pixels you need are the print's inches times the pixels per inch:

Print size Pixels needed at 300 per inch
4 x 6 in 1,200 x 1,800
5 x 7 in 1,500 x 2,100
8 x 10 in 2,400 x 3,000
A4 (8.27 x 11.69 in) 2,481 x 3,507
16 x 20 in 4,800 x 6,000

Going the other way, a 12 megapixel photo of 4,000 by 3,000 pixels prints up to about 13.3 by 10 inches at 300 per inch.

Frequently asked questions

Should web images be 72 DPI?

They can be 72, 300 or anything else: the browser shows them the same way. Choose the pixel dimensions and leave the tag alone.

Does 300 DPI make an image sharper on screen?

No. In our test the 72 and 300 files held identical pixels. Sharpness on a screen comes from having enough pixels for the size the image is shown at, which on a high-density screen is more than its width in CSS pixels.

Does lowering the DPI make a file smaller?

Not by itself. Our two files were both 327,563 bytes. The file shrinks only if the app also reduces the pixel count, or saves at a lower quality.

Someone asked me for a 300 DPI image. What do I send?

An image with enough pixels for the size they will print: the inches times 300. For a 5 by 7 inch print that is 1,500 by 2,100 pixels. Typing 300 into the tag of a small image adds no detail, and enlarging it in an editor invents pixels without adding real detail.

Do high-density screens need a higher DPI?

They need more pixels, not a different tag. Offer a larger file with srcset and let the browser pick, as our guide to image sizes shows.

What Heart Photos does

Heart Photos works in pixels throughout and does not read an image's DPI tag. Every image can be fetched at the width you need by adding it to the address, from /w320 to /w3840, and the viewer picks the smallest width that still gives each device pixel a pixel of its own. Those copies are AVIF made from the decoded pixels alone.

Your original is kept as you uploaded it. A JPEG is stored losslessly and Download Original hands back the very same file, byte for byte, so whatever DPI your camera or editor wrote is still there when you send it to a printer.

To try it, Open Heart Photos and upload an image.

More from the blog