Skip to content
FeetToPixelsDPI / PPI / CSS

Overview

For web images, DPI metadata does not control browser display size - pixel dimensions do. A 1200x800 image displays the same on a page whether the file metadata says 72 DPI, 96 DPI, or 300 DPI.

Why DPI Is Irrelevant for Web

Web browsers completely ignore the DPI (or PPI) metadata embedded in image files. When a browser renders an image, it uses only the pixel dimensions. A 1200 × 800 image saved at 72 DPI is rendered identically to the same image saved at 300 DPI. The files may differ slightly in metadata size, but the visual output is the same.

This is a common source of confusion: designers accustomed to print workflows assume they should set web images to 72 or 96 DPI. In reality, you can save at any DPI - it will not affect rendering, file size, or quality.

What Actually Matters for Web Images

  • Pixel dimensions: Serve images at the size they will display (or 2× for retina). A hero image displayed at 1200 CSS pixels wide should be 1200 px (standard) or 2400 px (retina).
  • File format: Use WebP for broad compatibility with excellent compression. Use AVIF for even better compression where supported. Fall back to JPEG for photos and PNG for graphics with transparency.
  • Compression: A well-compressed WebP image can be 25 - 35% smaller than an equivalent JPEG with no visible quality loss.
  • Lazy loading: Add loading="lazy" to images below the fold to defer loading until they enter the viewport.

Responsive Images for HiDPI Screens

On retina (2×) and high-density (3×) screens, images need more pixels to appear sharp. Use the HTML srcset attribute to serve different resolutions:

The browser selects the appropriate image based on the viewport width and device pixel ratio, ensuring sharp images without wasting bandwidth on standard displays.

<img
  src="hero-800w.webp"
  srcset="hero-800w.webp 800w,
          hero-1200w.webp 1200w,
          hero-2400w.webp 2400w"
  sizes="(max-width: 600px) 100vw, 1200px"
  alt="Hero image"
  loading="lazy"
/>

Web Image Optimization Checklist

Calculate the exact pixel dimensions you need for any layout with our Image Size Calculator.

  • Resize images to their maximum display size (do not serve a 4000 px image for a 1200 px container).
  • Use WebP or AVIF format with quality setting of 75 - 85%.
  • Provide 1× and 2× versions via srcset.
  • Add width and height attributes to prevent layout shift.
  • Use lazy loading for images below the initial viewport.
  • Consider using a CDN with automatic format negotiation.

Common Web Image Sizes by Use Case

Unlike print, web image sizing is driven by layout requirements, not DPI. The table below shows recommended pixel dimensions for typical web image placements. For retina screens, double the pixel width to avoid blurry output on high-density displays.

Use CaseStandard WidthRetina (2x)Notes
Hero / banner1920 px3840 pxFull-width background
Blog post header1200 px2400 px16:9 or 3:2 ratio
Thumbnail400 px800 pxSquare or 4:3
Product image800 px1600 px1:1 for consistency
Open Graph share image1200 x 630 pxN/AFixed aspect ratio
Favicon32 x 32 pxN/ASVG preferred

Exporting Images for Web in Design Software

When exporting from Photoshop, Illustrator, or Figma, the DPI setting in the export dialog does not affect how the image renders in a browser. What matters is the pixel dimensions and the output format.

In Photoshop: use Image > Export > Export As and choose WebP or JPEG. Set quality to 75-85%. The resolution field only affects print output and can be ignored for web.

In Figma: export at 1x for standard screens and 2x for retina. The DPI property is irrelevant; only the multiplier changes the final pixel dimensions.

In Illustrator: use Export > Export for Screens. Select pixels as the unit and match the target container size in your CSS layout.

In Canva: download as WebP or JPEG. Canva automatically sets an appropriate resolution. The download size slider controls compression, not DPI.

Practical Quality Notes for Best DPI for Web Images

This guide is most helpful when the result is tied to a real workflow, not treated as a loose number. For Best DPI for Web Images, verify print size, source pixel dimensions, and the DPI value requested by the printer or export workflow. That context prevents the common mistake of copying a pixel value into a print, web, or CSS workflow where the reference size is different.

Best DPI for Web Images should be checked with the formula, a realistic example, and the actual output requirement before you export or publish. If the number looks unexpectedly large or small, check the unit direction first, then check the DPI, base font size, viewport width, or physical measurement that controls the calculation.

A good review pass for Best DPI for Web Images is simple: calculate once, compare against a known example, and preview the final output at the size people will actually see. For web images, DPI metadata does not control browser display size - pixel dimensions do. A 1200x800 image displays the same on a page whether the file metadata says 72 DPI, 96 DPI, or 300 DPI.

Checks Before You Use the Result

  • Confirm that Best DPI for Web Images is using the same input unit your source file or design brief uses.
  • Save the DPI, viewport, or font-size setting next to the final Best DPI for Web Images value so another person can reproduce it.
  • Preview the Best DPI for Web Images output on the target medium before sending it to print, publishing it, or adding it to CSS.
  • Recalculate Best DPI for Web Images after resizing, cropping, changing aspect ratio, or changing the root font-size or viewport assumption.

When the Number Needs a Second Look

Recheck the result if the project moves from screen to print, from desktop to mobile, from one social platform placement to another, or from a draft export to a production file. Small context changes can make a correct Best DPI for Web Images answer wrong for the final job.

Sources

Reference Sources

These external references support the page's conversion formulas, resolution guidance, and unit explanations.

Frequently Asked Questions

It doesn't matter. Browsers ignore DPI metadata entirely. A 1200x800 image displays identically whether saved at 72, 96, or 300 DPI. Only the pixel dimensions and file format affect web display.

This is a persistent myth from early Mac displays, which had 72 PPI screens. Setting images to 72 DPI made 'points' and 'pixels' match 1:1 in early design software. Modern browsers render by pixel count, not DPI.

Use modern formats like WebP or AVIF. Resize to the actual display dimensions (no larger than needed). Compress with tools like Squoosh or ImageOptim. Use responsive images with srcset for different screen sizes.