dpi.js A library which reveals the pixel density of the client screen in your browser. It will attach them to the global window object which you can access. console.log(window.dpi); and for the metric system console.log(window.dpcm);