What Is My Viewport?

Instantly detect your current viewport width & height.
Viewport (CSS pixels)
— × —
DPR: • Zoom:
Viewport (CSS)
Viewport (physical)
Screen pixels
Orientation

Viewport = visible area of the web page in CSS pixels. Physical viewport = CSS viewport × DPR. If zoomed, DPR and viewport values change.

Browser Viewport

Your viewport is the visible area of a webpage inside your browser window. Unlike screen resolution, which measures the full pixel dimensions of your device’s display, the viewport measures only the space available for web content after subtracting browser toolbars, tabs, address bar, and system UI elements. It represents the actual width and height your device gives to a webpage.

Why Viewport Matters

A well-defined viewport is essential for responsive design, ensuring websites adjust smoothly across desktops, tablets, and mobile phones. Search engines like Google prioritize websites that display correctly at all viewport sizes, making viewport accuracy a direct factor in better user experience, lower bounce rates, and improved SEO performance. Your viewport dimensions help developers optimize layout, text scaling, UI scaling, and performance for your specific device.

Viewport size vs screen resolution

Your viewport is the visible area of a web page inside the browser — reported by window.innerWidth and window.innerHeight. It’s almost always smaller than your screen resolution because it excludes the browser toolbar, address bar, scrollbars, and (on desktop) any window chrome. On phones, the on-screen keyboard and browser UI shrink it further. That’s why the viewport is the number that actually matters for responsive web design: it’s the space your layout has to work with.

Common viewport sizes and breakpoints

Designers target ranges of viewport widths (“breakpoints”) rather than exact devices. These are the widths most responsive layouts are built around:

Device classTypical viewport widthCommon breakpoint
Small phones320–360 px< 576 px
Large phones390–430 px< 768 px
Tablets (portrait)768–834 px≥ 768 px
Tablets / small laptops1024–1280 px≥ 992 px
Desktops1280–1920 px≥ 1200 px

Note that viewport width is measured in CSS pixels, not physical pixels — a phone with a 1080-pixel-wide screen and a 3× device pixel ratio reports a viewport of only 360 CSS pixels. That’s exactly why responsive breakpoints use CSS pixels.

Frequently asked questions

What is a viewport?

The viewport is the visible portion of a web page inside the browser window, measured in CSS pixels. It excludes toolbars, scrollbars and window borders, so it’s smaller than your full screen resolution.

Why is my viewport smaller than my screen resolution?

Because the browser’s interface (tabs, address bar, scrollbars) takes up space, and because viewport is reported in CSS pixels while screen resolution is often stated in physical pixels. High-DPR displays make the gap larger.

How do I set the viewport for a website?

Add the meta tag <meta name="viewport" content="width=device-width, initial-scale=1"> in your page’s head. This tells mobile browsers to match the layout width to the device’s CSS-pixel width instead of zooming out a desktop layout.

Is viewport size the same as resolution?

No. Resolution is the total pixel count of the screen; viewport size is the CSS-pixel area currently available to the page inside the browser. They only match in rare full-screen, 1× cases.

Does the viewport change when I resize the window?

Yes — the viewport updates live as you resize the browser, rotate the device, or open/close the on-screen keyboard. The checker above reflects those changes in real time.