Skip to content
PrintablePaperKit

Pixel Ruler

Open, drop or paste a screenshot, then drag a box to read its exact size in image pixels, add guides, and pick colours as HEX or RGBA. Nothing leaves your computer.

  • Exact image pixels
  • Colour picker
  • Guides and grid
Crosshair
Snap
Grid
Checkerboard
Zoom: 100%
Cursor: 0px, 0px

Drop or paste an image. Click a ruler to add a guide (drag to move, right/⌘-click a ruler to remove). Hold Space or use the middle mouse to pan. Use Ctrl/Cmd + wheel to zoom. Click the image to pin and copy a color. Drag the selection handles to resize.

How to measure pixels in an image

  1. Load an image. Press Open image, drag a file onto the canvas, or paste a screenshot with Ctrl+V or Cmd+V.
  2. Zoom in. Use the 100%, 200% and 400% buttons or Ctrl or Cmd with the scroll wheel, and hold Space to pan.
  3. Drag a selection. Drag across the element; the Box readout shows its width and height in pixels and where it starts.
  4. Pick or export. Click a pixel to pin and copy its colour, or press Export PNG to save the selected area.

What the readouts tell you

ReadoutMeaning
ZoomHow large the image is drawn, from 5% up to 800%
ImageThe full width and height of the file in pixels
CursorThe pixel under the pointer, counted from 0 at the top left corner
ColourThat pixel’s colour as HEX and RGBA
BoxThe selection’s width × height, then the x and y of its top left corner

The rulers along the top and left edge are numbered in image pixels every 50, with a tick every 10, and they move with the image as you zoom and pan.

Measuring accurately

  • Zoom in before you measure. At 400% each pixel is a clear block, because the image is enlarged without blurring, so you can see exactly where an edge starts.
  • Measure from edge to edge. With Snap on, the selection lands on the lines between pixels. Start on the left edge of the element’s first pixel and finish on the right edge of its last, and a 24-pixel element reads 24, not 23.
  • Use guides for spacing. Click the top ruler for a vertical guide or the left ruler for a horizontal one, and drag it into place. Selections snap to a guide when you come close, which makes measuring the gap between two elements quicker. Right-click or Cmd-click the ruler near a guide to remove it.
  • Resize rather than redraw. Drag the green handles on the selection to adjust one side at a time. Press Escape to clear the selection.
  • Turn on Grid for lines every 10 pixels, darker every 50, when you want to check alignment by eye.

Image pixels and CSS pixels

A CSS pixel is the unit a web page is laid out in. A device pixel is a single dot on the screen. On many laptops and phones there are two or three device pixels across each CSS pixel, and a screenshot captures the device pixels. So an element styled at 16 px measures 32 px in a screenshot from a screen with a pixel ratio of 2, and 48 px from one with a ratio of 3.

For checking an exported image or icon, the image pixels are what you want. For comparing with a CSS value, divide by the pixel ratio of the screen that took the screenshot.

Checking spacing against a design

Many design systems build spacing from steps of 4 or 8 pixels, so values such as 4, 8, 12, 16, 24, 32 and 48 come up again and again. If a gap measures 22 or 23 px where the design says 24, it is worth a second look. Once you have measured it, select the area and press Export PNG to save that exact region for a review or a bug report.

Picking colours

The colour readout updates as you move. Click to pin a pixel and copy its HEX value. Antialiased edges and gradients change from one pixel to the next, so pick from a flat area in the middle of a shape rather than its edge. Turn on Checkerboard to see which parts of a PNG are transparent. Colours are read from the image as it is drawn, so a transparent pixel reports the background colour behind it.

The aspect ratio calculator works out the other side when you resize an image you have measured, and the unit converter turns pixels into points, picas and millimetres at the 96-per-inch web standard.

Frequently asked questions

Why is my measurement double what I expected?

The ruler measures the image’s own pixels. A screenshot taken on a high-density screen, such as a Retina display with a pixel ratio of 2, holds two image pixels for every CSS pixel, so a 100 px wide button measures 200 px. Divide by the screen’s pixel ratio to compare with a CSS value, or take the screenshot on a standard screen.

Do my images get uploaded?

No. The image is opened and drawn in your own browser and never sent anywhere, which matters when a screenshot shows unreleased work or customer details. Only your guide positions are remembered in this browser.

How do I pick a colour?

Hover over the image and the readout above it shows the colour under the cursor as HEX and RGBA. Click a pixel to pin it, then press Copy in the small panel to copy the HEX value. Zoom to 100% or more first, so the pixel you click is exactly the one you see.

What does Export PNG save?

It saves the area inside your selection box as a PNG at its original pixel size, named after its dimensions, for example selection_320x180.png. It is a straight crop of the image with nothing drawn on it, so you can check an asset or attach the exact region to a bug report.

Can I measure a live web page?

Take a screenshot and paste it in with Ctrl+V or Cmd+V. A web page cannot read the pixels of another tab for security reasons, so a screenshot is the way in, and it also gives you a fixed copy to measure again later.

How is this different from the online ruler?

The units. The online ruler measures real objects in centimetres and inches on a calibrated screen. The pixel ruler measures images in pixels, the unit screens, CSS and design tools work in.

Does it work on a phone or tablet?

It is built for a mouse or trackpad. Dragging a selection, adding guides and zooming with Ctrl or Cmd and the scroll wheel all rely on them, so a desktop or laptop works best.

More online tools

All 15 online tools