How accuracy works
Browsers do not know your pixel size
CSS defines an inch as exactly 96 CSS pixels, whatever the screen. A laptop, a phone and a 27-inch monitor all draw a "1 inch" CSS box at different physical sizes, off by several percent or more depending on the device. So this ruler never uses CSS inches, centimetres or millimetres.
One stored number
Calibration produces a single value: how many CSS pixels make one millimetre on your screen (pxPerMm). Every reading comes from it:
- millimetres = pixels ÷ pxPerMm
- centimetres = millimetres ÷ 10
- inches = millimetres ÷ 25.4 (exact by definition)
Calibration methods
- Card (recommended). Credit and debit cards, and most driving licences, follow ISO/IEC 7810 ID-1: 85.60 × 53.98 mm. Matching an outline to a real card gives the most reliable result.
- Coin. Uses the nominal diameter published by the mint. Wear makes old coins slightly smaller.
- Paper edge. A4 (210 × 297 mm) or US Letter (215.9 × 279.4 mm). Good on large screens.
- Custom length. Any object whose length you know from a reliable source, such as a steel ruler, from 10 mm to 1000 mm. It has to fit across the screen.
- Screen size. pxPerMm = (√(w² + h²) ÷ diagonal in inches) ÷ 25.4, from the native resolution, then converted to CSS pixels. Scaled display modes and rounded marketing diagonals can add error.
- PPI entry and device presets: convenient estimates. Browsers on iPhone and iPad do not reveal the model, so a preset is never chosen for you.
Verify with a second object
After calibrating, the tool draws a different reference, such as a coin or the card's other edge, at the size your calibration predicts. You adjust it to the real object and the tool reports the error: (measured − true) ÷ true × 100. Above 1.5% it offers to average both calibrations or to start again. A calibration counts as verified when the second object reads within 1.5% of its true size.
Zoom, monitors and resolution
A calibration belongs to one screen at one browser zoom. It is stored with the screen size, the device pixel ratio and a zoom estimate. If the device pixel ratio changes on the same screen (browser zoom in most browsers, or a change to display scaling) the ruler rescales by the exact ratio and tells you. If only the zoom estimate moves, or the screen itself changes, it warns you and asks you to rescale or recalibrate. Different screens keep separate calibrations.
Limits
On-screen rulers are approximate. Parallax from glass thickness, how flat the object lies and how carefully you match edges all matter. Never use the readings where exact measurement is critical.