A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

devicePixelRatio on desktops. Is it always 2.0?


I can’t find any information on device pixel ratio values for desktop monitors. Are they always 2.0 nowadays?

It is easy to find information on mobile devices. For example:


I can’t find information on desktops/monitors.

The lack of physical units, plus uncertainty about devicePixelRatio, makes designing a bit of a black box. Designing for pixel ratios of 3 can be more costly (for example based on image size).


It’s not always 2.


It’s pretty much whatever you put as your monitor scaling. On my Windows laptop, I set scaling to 175% because that is a readable text size for me and lets me fit information on my screen. So my pixel ratio is approximately 1.76. The default value that Windows thinks it should use is 250% (which gives me a pixel ratio of 2.5). I can change mine on the fly—Firefox was one of the first browsers to properly support per-monitor DPI introduced in Windows 8 ;-).