How the Screen Resolution Detector Reads Your Display
AnyTool Screen Resolution Detector runs entirely on standard browser APIs — window.screen, window and matchMedia — with no library, CDN, upload or server. It separates the three numbers people confuse: the viewport (window.innerWidth × innerHeight, the page canvas your CSS media queries actually target), the screen resolution (window.screen.width × height, the logical screen in CSS pixels after OS display scaling) and the device pixel ratio (window.devicePixelRatio, the multiplier from CSS pixels to physical pixels). From those it estimates the native/physical resolution as screen × DPR and labels it Full HD, 1440p or 4K, and reduces the aspect ratio with a gcd so 1920 × 1080 reads 16:9. Refresh rate — which browsers do not expose directly — is measured locally by averaging requestAnimationFrame deltas over about a second to approximate 60, 120 or 144 Hz. Every value re-reads live on resize, orientationchange and zoom, and listeners plus the rAF loop are torn down on unmount.
- Reads window.screen, window and matchMedia — no upload, no server
- Separates viewport, screen resolution and DPR (all in CSS pixels)
- Native resolution estimated as screen × DPR with a Full HD / 1440p / 4K label
- Refresh rate measured by averaging requestAnimationFrame deltas (~60/120/144 Hz)
- Live updates on resize / orientationchange / zoom; listeners cleaned up on unmount
