Viewport or screen size?

The viewport is the part of the browser window that shows the page, the area that CSS media queries respond to. The screen size is the size of the whole display. Both are measured in CSS pixels, which aren't the display's physical pixels: on phones and high resolution laptops, one CSS pixel covers two or three physical pixels. That's why a phone with a display 1080 pixels wide reports a width of around 360 to 430.

Tool description

Open the page and it shows four values in pixels: Viewport width and Viewport height, the visible page area in your browser, and Screen width and Screen height, the size of your display. Each has a copy button. Resize the window or turn your phone, and the values update right away.

Features

  • Viewport and screen size together, in CSS pixels
  • Updates as you resize the window or rotate the device
  • A copy button on every value

Good to know

  • Viewport width includes the vertical scrollbar, the same width CSS media queries check.
  • Screen size depends on your display scaling: a laptop with a 2560 by 1600 display at 200% scaling reports 1280 by 800. Multiply by the scaling factor to get the physical resolution.
  • Zooming the page changes the viewport values, because zooming in makes each CSS pixel bigger.
  • In JavaScript, the same values are window.innerWidth, window.innerHeight, screen.width and screen.height.
  • The values are read in your browser and aren't sent anywhere.