What is my viewport size?

Your browser window (viewport)

Detecting…

Related tools

What is the viewport?

Your viewport size is shown in the result: the width and height of the area inside your browser window where websites are drawn. Resize the window or zoom in and out, and the value updates instantly.

What the viewport is

The viewport is the visible part of a web page. It excludes the browser’s own interface, such as tabs, the address bar and bookmarks, and anything outside the browser, such as the taskbar or dock. It’s always the same size as your screen or smaller.

Why websites care about the viewport

Responsive websites change their layout depending on the viewport width, using CSS breakpoints. Many sites switch layouts around these widths:

  • below 640 pixels: phone layout, single column, menu behind a button
  • 768 pixels: tablet layout
  • 1024 pixels: small laptop layout
  • 1280 pixels and up: full desktop layout

That’s why the same site can look different in a narrow window on a large screen.

The viewport on phones

Phones report a viewport in CSS pixels, not physical pixels. A phone with a 1170-pixel-wide display and a device pixel ratio of 3 has a 390-pixel viewport. Mobile sites use the width=device-width viewport setting to match that width; without it, phones render pages as if they were about 980 pixels wide and shrink them.

Testing other viewport sizes

Browser developer tools can simulate any viewport. In Chrome, Edge and Firefox, press F12 (Cmd + Option + I on a Mac) and turn on the device toolbar or responsive design mode to test layouts for phones and tablets without changing your window.

Frequently asked questions

What is the difference between screen size and viewport size?

Screen size is your whole display. Viewport size is the area inside the browser window where pages are drawn, so it gets smaller when the window isn’t maximized or when toolbars take up space.

Why does my viewport change when I zoom?

Zooming in makes every CSS pixel larger, so fewer of them fit in the window. At 200% zoom, a 1400-pixel-wide window has a 700-pixel viewport, which is why zoomed pages often switch to their mobile layout.

Does the viewport include the scrollbar?

The size shown here includes the vertical scrollbar, if your system displays one. The space available to page content is a few pixels narrower.