The viewport is the visible area of a web page inside the browser window — what is left after toolbars, the address bar and scrollbars. CSS media queries and responsive layouts respond to this size, not to your full screen resolution, so knowing it precisely is essential for front-end and responsive-design work. This checker shows your live viewport plus the active breakpoint, orientation, scrollbar width, device pixel ratio and the physical viewport.
How it works
Every value is read directly from the browser and refreshed on each resize and orientationchange event:
- CSS pixels:
window.innerWidth × window.innerHeight— the viewport that media queries see. - Document area:
document.documentElement.clientWidth/Height, which excludes the scrollbar. - Scrollbar width:
innerWidth − clientWidth. - Orientation: Landscape if width ≥ height, otherwise Portrait.
- Device pixel ratio:
window.devicePixelRatio. - Physical viewport: the CSS size multiplied by the DPR, rounded.
Example
On a Retina laptop with a maximised window you might see:
| Value | Reading |
|---|---|
| CSS pixels | 1280 × 720 |
| Breakpoint | Desktop (xl 1280–1535px) |
| Orientation | Landscape |
| Scrollbar width | 15 px |
| Device pixel ratio | 2× |
| Physical viewport | 2560 × 1440 |
Here a 1280-px-wide CSS viewport falls in Tailwind’s xl range, and at DPR 2 it occupies 2560 physical device pixels. Resize the window or rotate your phone and every value updates instantly — all measurements stay in your browser.