bookmarklet.one

Viewport Size Display Bookmarklet

Show the live viewport width and height, device pixel ratio and the current Tailwind, Bootstrap and page CSS breakpoint while you resize. Free bookmarklet.

Viewport Size Display
← Drag this button to your bookmarks bar.Click it here to try it on this page first.

On a phone? Use Copy code, then save it as a bookmark's URL — step-by-step guide.

Web Dev CSS DesignUpdated 2026-11-27Free · No extension · Runs locally

Viewport Size Display shows the current viewport size in CSS pixels in a small floating panel and updates it live while you resize the window, zoom or rotate a device. Next to width and height it shows the device pixel ratio, the visual viewport (affected by pinch zoom), the size without scrollbars, screen size, orientation and full document size.

It also tells you which responsive breakpoint is active right now: the Tailwind CSS name (sm, md, lg, xl, 2xl), the Bootstrap tier, and, best of all, the actual min-width and max-width values found in the page's own media queries, with the ones currently matching highlighted. That shows exactly where the layout of this specific site changes.

Responsive designers and QA testers use it to reproduce "it breaks at 1024 pixels" reports and to check layouts between breakpoints without opening device emulation.

What it does

  • Live width × height of the layout viewport in CSS pixels
  • Device pixel ratio, visual viewport and zoom scale, size without scrollbars, screen and document size
  • Current Tailwind and Bootstrap breakpoint names
  • Width breakpoints from the page's own readable media queries, with matching ones highlighted
  • Updates on resize and zoom; Copy button for the size; run again to close

How to install the Viewport Size Display bookmarklet

  1. Show your bookmarks bar. Press Ctrl+Shift+B on Windows/Linux or Cmd+Shift+B on a Mac (Chrome, Edge, Brave, Firefox). In Safari choose View › Show Favorites Bar.
  2. Drag the blue button above onto the bar. That's it — the bookmark now holds the code.
  3. Open any website and click the bookmark to run it on that page. Click it again to close it.

Can't drag (phone, tablet, locked-down browser)? Copy the code below, create any bookmark, then edit it and paste the code as its URL. See how to add a bookmarklet in every browser.

How to use it

  1. Click Viewport Size Display in your bookmarks bar.
  2. Resize the browser window or zoom; the numbers update live.
  3. Watch the page breakpoints list to see where the site's layout changes.
  4. Press Copy size to paste the exact size into a bug report, then press Esc to close.

Which width is the real one?

CSS media queries use the layout viewport width, which includes the vertical scrollbar; that is the big number at the top. document.documentElement.clientWidth excludes the scrollbar and is shown as "Without scrollbars". Browser zoom changes CSS pixels: at 200% zoom a 1280-pixel window reports 640, exactly as media queries see it. The device pixel ratio tells you how many physical pixels make up one CSS pixel, which matters for choosing image sizes in srcset. Media queries from cross-origin stylesheets cannot be read, so their breakpoints are not listed.

Bookmarklet code

This is the exact code inside the button above (8,168 characters). It runs only in your browser and sends nothing to us. Paste it into the Bookmarklet Decoder to read it formatted.

Frequently asked questions

Why is the width different from my screen resolution?

Viewport size is measured in CSS pixels inside the browser window, which depends on window size, zoom and the device pixel ratio.

Which breakpoint system does it use?

It shows Tailwind and Bootstrap defaults as reference, plus the real breakpoints from the page's own CSS when they are readable.

Does it work on phones?

Yes, in mobile browsers that support bookmarklets. Rotate the device and the panel updates.

Related bookmarklets

Show CSS grid tracks and flexbox containers on any page, plus an adjustable 12-column layout grid for checking alignment.…

Free mobile viewport checker bookmarklet: validates the meta viewport tag, finds elements causing horizontal scroll and…

Outline every element on a page with a color based on its nesting depth to spot overflow, stray margins and layout bugs…

Count DOM elements, nodes and nesting depth on any page, with a sortable per-tag table and Lighthouse DOM-size…