Window.devicePixelRatio
- WDRead-only property that returns the ratio of the (vertical) size of one physical pixel on the current display device to the size of one CSS pixel.
Chrome
- ✅ 4 - 150: Supported
- ✅ 151: Supported
- ✅ 152 - 154: Supported
Edge
- ✅ 12 - 150: Supported
- ✅ 151: Supported
Safari
- ◐ 3.1 - 26.5: Partial support
- ◐ 26.6: Partial support
- ◐ 27 - TP: Partial support
Firefox
- ❌ 2 - 17: Not supported
- ✅ 18 - 153: Supported
- ✅ 154: Supported
- ✅ 155 - 157: Supported
Opera
- ❌ 9 - 11.5: Not supported
- ✅ 11.6 - 133: Supported
- ✅ 134: Supported
IE
- ❌ 5.5 - 10: Not supported
- ✅ 11: Supported
Chrome for Android
- ✅ 151: Supported
Safari on iOS
- ◐ 3.2 - 26.5: Partial support
- ◐ 26.6: Partial support
Samsung Internet
- ✅ 4 - 29: Supported
- ✅ 30: Supported
Opera Mini
- ✅ all: Supported
Opera Mobile
- ❌ 10 - 11.5: Not supported
- ✅ 12 - 12.1: Supported
- ✅ 80: Supported
UC Browser for Android
- ✅ 15.5: Supported
Android Browser
- ✅ 2.1 - 4.4.4: Supported
- ✅ 151: Supported
Firefox for Android
- ✅ 153: Supported
QQ Browser
- ✅ 14.9: Supported
Baidu Browser
- ✅ 13.52: Supported
KaiOS Browser
- ✅ 2.5: Supported
- ✅ 3: Supported
As the page is zoomed in the number of device pixels that one CSS pixel covers increases, and therefore the value of devicePixelRatio will also increase.
- Resources:
- MDN Web Docs - devicePixelRatio