What Is My Viewport?
Your Viewport
Detecting…
- Browser Window Size
- Detecting…
- Device Pixel Ratio
- Detecting…
Check your browser viewport size in CSS pixels, live. See the exact width and height available to web pages and how it changes as you resize the window.
Last updated
Check next
All display toolsHow to use this tool
- Your viewport width and height appear in the Live Result box as soon as the page loads.
- Resize your browser window, rotate your phone, or open the developer tools panel. The value updates instantly.
- Compare the viewport with the browser window size below it to see how much space toolbars, tabs and scrollbars take up.
What is it?
The viewport is the visible area inside your browser where web pages are rendered, measured in CSS pixels. It excludes browser UI chrome like toolbars, tabs, and OS taskbars, representing only the canvas where website content is drawn.
How it works
The viewport is measured with window.innerWidth and window.innerHeight, which return the size of the area where the page is drawn, in CSS pixels, including any vertical scrollbar. This is the same value CSS media queries such as @media (max-width: 768px) are tested against, which makes it the number that matters most for responsive design. The tool listens for resize and orientation-change events, so the result stays accurate while you move or resize the window.
Why this matters
Viewport size is the most critical metric for responsive web design. CSS media queries use viewport dimensions to adapt layouts for mobile, tablet, and desktop screens. Developers must ensure their applications look perfect at specific viewport breakpoints.
Practical Use Cases
- Web Developers testing CSS breakpoints to ensure responsive layouts trigger correctly.
- QA Testers documenting the exact viewport size where a visual bug occurs on a specific device.
- Designers matching their Figma or Sketch artboard dimensions to real-world browser viewports.
How to check manually
Chrome / Edge DevTools
Press F12 (or Cmd + Option + I on Mac) and resize the window. Chrome shows the viewport size in the top-right corner while you drag. The device toolbar (Ctrl + Shift + M) lets you pick an exact size.
Firefox
Open Responsive Design Mode with Ctrl + Shift + M (Cmd + Option + M on Mac). The current viewport size is shown above the page.
Browser console
Open the console and type window.innerWidth + " × " + window.innerHeight, then press Enter.
Common values
| Label | Value |
|---|---|
| Mobile (typical) | 390 × 844 |
| Tablet (typical) | 768 × 1024 |
| Desktop (typical) | 1440 × 900 |
Troubleshooting
- Viewport does not match screen resolution
- This is expected. The viewport is always smaller than full screen resolution because of browser UI, scrollbars, and window sizing.
Frequently asked questions
What is a browser viewport?
A browser viewport is the physical area on your screen where web content is actively rendered, excluding the browser's own interface elements.
Does viewport size include the scrollbar?
In most modern browsers (especially on Windows), viewport width includes the scrollbar area when scrollbars are visible, though overlay scrollbars (common on macOS and mobile) behave differently.
Why is my viewport smaller than my screen resolution?
The viewport excludes the browser tabs, address bar, bookmarks bar and operating system taskbar. On a 1920 × 1080 screen, a maximized Chrome window typically has a viewport of around 1920 × 950.
What viewport sizes should I design for?
Common breakpoints are 360–430px wide for phones, 768–834px for tablets in portrait, 1024px for tablets in landscape and small laptops, and 1280–1440px for desktops. Test the in-between widths too, not just the breakpoints.
Why does my mobile viewport height change when I scroll?
Mobile browsers hide and show the address bar as you scroll, which changes the visible height. CSS units like 100dvh (dynamic viewport height) and 100svh (small viewport height) were added to handle this.
Does browser zoom change the viewport?
Yes. Zooming to 200% halves the viewport width in CSS pixels, which is why zooming in can trigger a site's mobile layout on a desktop computer.
Explore more diagnostics
Visit the DeviceScope homepage for a complete live dashboard, or browse all display & screen tests.