ExtensionsDeveloper toolsPixel Ruler

Pixel Ruler iconPixel Ruler

Measure pixels, sizes and spacing on any web page

A button sits a few pixels too low, a card is wider than the mockup, the gap between two blocks looks uneven. Taking a screenshot and counting pixels in an image editor is slow, and opening DevTools can make hover states disappear when the panel takes focus.

Add to Chrome — free (Pixel Ruler)
A card on a web page outlined by Pixel Ruler with a 520 × 230 px size label and rulers along the top and left edges

Pixel Ruler draws a ruler on top of the page you are already looking at and reports values in CSS pixels, the same unit that DevTools and your stylesheet use.

What it does

Pixel Ruler draws a ruler over the page you are viewing, so you can drag between two points or hover an element and read its size in CSS pixels.

  • Drag between any two points to read the distance in CSS pixels
  • Hover an element to see its CSS selector, width and height; click it to add its padding and the gaps to neighbouring blocks
  • Vertical and horizontal guides for checking alignment
  • Scales along the top and left edges of the window
  • One key copies the measured size; a click on the label of a selected element copies its CSS selector
  • Shift locks a measurement to one axis, and arrow keys move the point by 1 px

How it works

  1. Pin the extension and open the page you want to check: a live site, a staging server or a page behind a login.
  2. Click the toolbar icon and choose Measure this page, or press Alt+Shift+M. An overlay covers the page, with a pixel scale running across the top and down the left side. Because the overlay is drawn inside the tab, it scrolls with the content and redraws when the layout reflows.
  3. Press and drag between two points to read the distance.
  4. Rest the pointer on an element: a label shows its CSS selector, width and height. Click it to see its padding and how far it sits from the elements next to it. Both need the Element size on hover setting in the popup, which is on by default. Margins are not shown.
  5. Drop horizontal or vertical guides to check that blocks line up.
  6. Press Esc to clear the current measurement, and Esc again to close the ruler. Alt+Shift+M turns it off as well, and you can change that shortcut at chrome://extensions/shortcuts.

Where it cannot reach

Chrome blocks every extension, this one included, from its own system pages, from other extensions and from the Chrome Web Store, and the ruler does not try them. It also will not start anywhere on chrome.google.com, on any address ending in .pdf or on local files opened from your computer (file://), which it does not support. On a page it can measure, it works in the top frame only: elements inside an iframe cannot be selected, though you can still drag a measurement across the iframe. On any other page, it stays off until you start it and is gone again after you press Esc twice, click its close button or press the shortcut. It does not follow route changes in single-page apps, so after one the ruler and the last selection stay on screen until you close it.

Who it is for

  • Front-end developers comparing a built page with a design mockup.
  • Designers checking spacing on the live site when the handoff file is out of date.
  • QA engineers who want to report a layout bug with an exact figure rather than a vague description.
  • People checking how large an image or a logo is actually drawn on the page, which often differs from the size of the source file.

What it can't do

  • Reports CSS pixels only, not centimetres or inches.
  • Does not start on Chrome system pages, other extensions' pages, the Chrome Web Store, addresses ending in .pdf or local files (file://).
  • Cannot select elements inside an iframe, even one from the same site; dragging a measurement across the iframe still works.
  • Works inside Chrome tabs only; it does not measure other desktop apps or windows.
  • Starts only from Measure this page in its popup or from its shortcut, and stays open when a single-page app changes its URL without reloading.

Permissions and your data

Does not read or change any web page on its own.

storage
Remembers four on/off settings, that the intro card was shown, your last measurement for the browser session and the state of the rating prompt.
activeTab
Gives the extension access to the current tab only after you click its toolbar icon or press its shortcut, so the ruler can be drawn there.
scripting
Places the ruler overlay on that tab when you start it; the overlay is removed when you press Esc or leave the page.
Where your data goesPixel Ruler reads the layout of the page: where elements sit, how big they are, their computed styles, and the tag, id and classes it needs for the CSS selector it shows; it does not read page text, form fields, passwords or cookies. Measuring happens inside the tab, and the extension makes no network requests.

Pixel Ruler guides

Try Pixel Ruler

Free. Remove it any time from the Chrome toolbar.

Add to Chrome — free (Pixel Ruler)