How to measure pixels in an image
- Load an image. Press Open image, drag a file onto the canvas, or paste a screenshot with Ctrl+V or Cmd+V.
- Zoom in. Use the 100%, 200% and 400% buttons or Ctrl or Cmd with the scroll wheel, and hold Space to pan.
- Drag a selection. Drag across the element; the Box readout shows its width and height in pixels and where it starts.
- 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
| Readout | Meaning |
|---|---|
| Zoom | How large the image is drawn, from 5% up to 800% |
| Image | The full width and height of the file in pixels |
| Cursor | The pixel under the pointer, counted from 0 at the top left corner |
| Colour | That pixel’s colour as HEX and RGBA |
| Box | The 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.
Related tools
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.