Pixel Ruler Online
Drop in a screenshot or mockup, draw a box and read its size in pixels, then convert it to real-world units.
Calibrate screen scale
Hold your card against the screen. Move the slider until the edges match.
Other methods: coin, device or diagonal
Screen scale (CSS pixels per inch)
Calibrate once with a bank card; every 1:1 tool on this site then uses the same scale.
- CSS viewport
- —
- Physical resolution
- —
- Device pixel ratio
- —
- Aspect ratio
- —
- Estimated PPI
- —
- Calibrated PPI
- —
Screenshot & mockup pixel measurer
Images stay on this device. Drop a file on the frame, then drag to draw a box.
px ↔ mm ↔ cm ↔ in converter
At 96 DPI: 1 px = 0.2646 mm · 1 mm = 3.780 px
Three kinds of pixel, and which one you are measuring
This ruler measures in CSS pixels by default and lets you switch the pixel space to device pixels, so you can match whichever number your design tool or developer uses.
- CSS pixels: the unit websites are designed in. By definition 96 CSS px make one CSS inch, whatever the screen.
- Device pixels: the physical dots on your display. A phone with a device pixel ratio (DPR) of 3 uses 3 × 3 device pixels for each CSS pixel.
- Image pixels: the pixels stored in a photo or screenshot file. They map to the screen only at 100% zoom on a 1× display.
Measuring a screenshot or design mockup
Load a screenshot and drag a selection over a button, an icon or a gap. The box width and height appear in pixels as you drag; use the sample layout grid to practice.
One trap catches nearly everyone: screenshots from Retina Macs, iPhones and most Android phones are saved in device pixels. A button that is 300 CSS px wide on a 2× MacBook appears 600 px wide in the screenshot, and 900 px wide in a 3× iPhone screenshot. Divide by the DPR to get the size a developer would write in CSS.
Converting pixels to mm and inches
Pixels have no fixed physical size; you need a pixels-per-inch figure to convert. The formula is millimeters = pixels × 25.4 ÷ PPI. The three numbers people mean most often are 96 (the CSS reference), 72 (PDF points and old Mac screens) and 300 (photo printing).
| Pixels | At 96 PPI (CSS) | At 72 PPI (PDF points) | At 300 DPI (print) |
|---|---|---|---|
| 1 px | 0.26 mm | 0.35 mm | 0.08 mm |
| 10 px | 2.65 mm | 3.53 mm | 0.85 mm |
| 100 px | 26.46 mm (1.04 in) | 35.28 mm (1.39 in) | 8.47 mm (0.33 in) |
| 300 px | 79.38 mm (3.13 in) | 105.83 mm (4.17 in) | 25.40 mm (1.00 in) |
| 1000 px | 264.58 mm (10.42 in) | 352.78 mm (13.89 in) | 84.67 mm (3.33 in) |
Your screen’s real pixel density
Physical density is the diagonal resolution divided by the diagonal size: √(width² + height²) ÷ inches. A 24-inch 1920 × 1080 monitor has about 92 pixels per inch, a 27-inch 2560 × 1440 about 109, a 27-inch 4K about 163, a 15.6-inch 1080p laptop about 141, a 14-inch MacBook Pro 254, and an iPhone 15 Pro 460.
When you calibrate this page with a bank card, it works out your real CSS pixels per inch and shows it under “Screen scale”. Pixel distances then convert to true millimeters on your own display.
Zoom, display scaling and odd ratios
Windows display scaling at 125% or 150% gives a DPR of 1.25 or 1.5, and browser zoom changes it again. At fractional ratios a 1-pixel line can land between two device pixels and look blurry or 2 pixels wide. If measurements look half a pixel off, check zoom (Ctrl + 0 or Cmd + 0) before blaming the design.