How to check viewport size

Viewport size is the space a web page can use inside the browser. Measuring it in CSS pixels helps explain responsive breakpoints, wrapping, overflow, and mobile keyboard behavior.

Check viewport size

Measure the current viewport

  1. Open the Viewport Size Checker in the browser being tested.
  2. Read the live layout viewport width and height.
  3. Resize the window or rotate the device.
  4. Compare document and visual viewport values where available.
  5. Pause live updates to hold a snapshot for copying.

Which viewport value should you use?

ReadingWhat it representsTypical use
Layout viewportThe CSS layout area, including scrollbars in the window dimensionsResponsive layout and breakpoint checks
Document client sizeThe document area excluding scrollbarsDiagnosing a scrollbar-width difference
Visual viewportThe region currently visible to the userPinch zoom and on-screen keyboard behavior

Visual viewport values appear only when the browser exposes that API.

Viewport size versus screen resolution

The viewport is inside the browser window. Screen resolution describes the current display. A 1920-pixel-wide screen can hold a much narrower browser window, so screen dimensions are not a substitute for viewport measurements.

Responsive testing rule: record the viewport width where the layout changes, not the marketing name of a device.

CSS pixels are the useful unit

Viewport readings use CSS pixels rather than raw hardware pixels. This lets a layout remain usable across displays with different density. Browser zoom, device scaling, scrollbars, and embedded frames can affect the reported dimensions. If the page is inside an iframe, it measures the frame's viewport.

Test more than a few presets

  • Drag slowly across each breakpoint to find awkward intermediate widths.
  • Check both portrait and landscape orientations.
  • Test browser zoom and large text settings.
  • Open the mobile keyboard near fixed controls and form fields.
  • Look for horizontal overflow at narrow widths.

Open the Viewport Size Checker