Online Ruler

An on-screen ruler in mm, cm and inches, calibrated against a credit card or your screen size so the tick marks match real life. Free, nothing uploaded.

🌐 Español

⚠️ A CSS pixel has no fixed real-world size — it depends on your monitor and zoom level. Calibrate below against a real object so the ruler is actually accurate on your screen.

Hold a real credit card, debit card, driver's license or ID card (they're all the same standard size) up to your screen. Drag the handle below until the box exactly matches your card's width.

Match this to your card

Box width: 300 px (card is 85.6mm × 53.98mm — ISO/IEC 7810 ID-1 format)

🔒 Private by design: everything runs locally in your browser and never uploaded to any server.

A CSS pixel is not a millimetre

Ask a browser for a box 96 pixels wide and you have not asked for an inch. You have asked for 96 CSS pixels, a unit whose real size on glass depends on the panel’s pixel density, on the operating system’s display scaling, and on whatever zoom level the page happens to be sitting at. The CSS specification does anchor its reference pixel to one ninety-sixth of an inch, and that constant is in this tool’s source, but it is there as the naive assumption to be corrected, not as a measurement. It survives contact with a real 141 PPI laptop panel for about half a second.

Device pixel ratio does not rescue it either. That number relates CSS pixels to device pixels; it says nothing about millimetres. Two 24 inch monitors, one 1080p and one 4K, disagree about how many device pixels fit in an inch and agree about nothing useful in between.

So this page draws no ruler at all until you have calibrated one. That is a deliberate refusal: a tool whose entire value is being true to scale cannot open with a guessed scale and a confident set of numbers printed under it.

Two calibration paths, and where each one goes wrong

The first path uses a card. Bank cards, debit cards, most driving licences and most ID cards are built to the ISO/IEC 7810 ID-1 format, 85.60 mm by 53.98 mm, everywhere in the world. The page draws a box in exactly that proportion, starting 300 CSS pixels wide and refusing to go below 60, with a grab strip down its right edge. Hold your own card against the screen, drag until the two edges line up, and press Use this calibration. The arithmetic behind the button is a single division: the box width in CSS pixels over 85.6.

The second path asks for three numbers instead: Diagonal size (inches), Horizontal resolution (px) and Vertical resolution (px), pre-filled with 15.6, 1920 and 1080. It takes the diagonal in pixels, takes the diagonal in millimetres, and divides. With those defaults it previews an estimated physical screen width of 34.5 cm, or 13.6 in, and calibrates to 5.560 px/mm, which the ruler then reports as 141.2 px per inch. Press the button with an impossible value in one of the three fields and it refuses, printing a plain line of text under them rather than calibrating to nonsense.

There is one trap worth spelling out. The figure to type is the resolution your browser is laying pages out in, not the number printed on the box the monitor came in. Our screen resolution checker shows both halves of that question, the resolution the browser reports and your device pixel ratio. Where those two disagree, feeding the panel’s native pixel count into the diagonal method scales every tick mark by exactly that ratio, which is why the card is the safer choice on a HiDPI laptop. For the record, on that 15.6 inch 1080p panel the card box has to be dragged out to roughly 476 px before it matches a real card.

What the 30 cm track actually draws

In metric mode the widget places a tick at every whole millimetre across 300 mm, 301 of them, with a labelled major tick each centimetre and a taller unlabelled one at each half centimetre. Switching between mm and cm changes only the labels, never the positions: cm counts 0 to 30, mm counts 0, 10, 20 and onward to 300. Inch mode redraws at eighth-inch spacing over twelve inches, 97 ticks, labelled at each whole inch.

The track itself is 90 px tall with the ticks hanging from its baseline, and it scrolls sideways when the calibrated ruler outgrows your window, which it usually does. At that 5.560 px/mm calibration, 300 mm of ruler is about 1668 CSS pixels wide.

Dragging out a measurement, and one quirk to know

Press anywhere on the track and drag. A shaded band follows the pointer and a line underneath reads out the span in whichever unit the toolbar is set to, millimetres and centimetres to one decimal place, inches to three.

One behaviour to be aware of, because it looks like a bug the first time it happens: the widget never releases the anchor point when you lift the pointer. Move the cursor back across the ruler afterwards and the band keeps stretching from where you originally pressed. Nothing is broken, and the reading is still correct for wherever the pointer currently is; just press down again at the new starting point when you want a fresh span.

Getting a true reading in four moves

  1. Choose Calibrate with a credit card or Calibrate with screen size from the two buttons at the top of the calibration panel.
  2. For the card, drag the handle on the right edge of the box until it matches a real card held against the screen. For the screen method, fill in the diagonal in inches plus the horizontal and vertical resolution, and check the estimated physical width it previews back at you.
  3. Press Use this calibration. The ruler replaces the calibration panel and the pixels per millimetre figure is saved for next time.
  4. Pick mm, cm or in in the toolbar, hold the object against the screen, and either read the ticks or drag along the track for a decimal readout. Recalibrate starts the whole thing over.

Where a screen ruler stops being good enough

Calibration error propagates. On the panel above, where a real card matches a box about 476 pixels wide, ending up five pixels out is roughly one percent wrong everywhere on the scale, which nobody will notice checking whether a phone fits an envelope and which matters a great deal if you are cutting material to length. Thickness works against you as well: anything you hold against the display sits a few millimetres in front of the pixels, so reading at an angle introduces parallax that no software can remove.

Treat it as a good sanity check, not an instrument. When the answer needs to be in a different unit afterwards, the unit converter handles length in both directions. When you want squares of a known size on paper rather than on glass, the graph paper generator builds the grid in millimetres and hands you a PDF. And when what you are actually measuring is a foot, the shoe size converter takes that centimetre figure straight into US, UK and EU sizes. There are more display and input widgets like this one on the testers hub.

See it in action

Screenshot of the Online Ruler tool with an on-screen ruler that opens by admitting its own problem - a CSS pixel has no fixed real-world size, since it depends on the monitor and the zoom level - and offers calibration against a real object so the measurements are actually true on that display
Online Ruler mid-process: an on-screen ruler that opens by admitting its own problem - a CSS pixel has no fixed real-world size, since it depends on the monitor and the zoom level - and offers calibration against a real object so the measurements are actually true on that display.
Diagram: where the work happens on a SysFenix page that has no file input at all: the tool arrives as ordinary JavaScript inside the page, works the answer out on your own device and renders it in place, so the upload, queue and server-side record a typical online tool needs never happen
Where the work happens on a SysFenix page that has no file input at all: the tool arrives as ordinary JavaScript inside the page, works the answer out on your own device and renders it in place, so the upload, queue and server-side record a typical online tool needs never happen.

Frequently asked questions

Where does the calibration get stored, and how do I clear it?

One number, the calibrated pixels per millimetre, is written to this browser's local storage under a key belonging to this site. It holds nothing else, and it is read once when the page loads so a return visit lands straight on the ruler instead of the calibration screen. Pressing Recalibrate deletes that stored value and puts the calibration screen back. Clearing site data for this domain removes it too.

I changed my browser zoom and the tick marks look wrong now. What should I do?

Press Recalibrate and do it again. The saved figure describes CSS pixels as they were rendering at the moment you saved it, and zooming changes how much glass a CSS pixel covers. Nothing in the widget watches for a zoom change, so it will keep happily drawing a scale that was right ten minutes ago. The same applies if you drag the window to a second monitor with a different pixel density.

On a high-density screen, which of the two methods should I trust?

The card. Dragging the box measures the screen exactly as it is rendering right now, whatever the device pixel ratio and whatever zoom is applied. The screen-size method assumes the resolution you type is the same coordinate space the page is laid out in, so on a display where the browser reports fewer CSS pixels than the panel physically has, typing the panel's native figure scales every tick by that ratio.

Why does the scale stop at 30 centimetres and 12 inches?

Those two lengths are fixed in the widget, chosen because a longer ruler mostly buys sideways scrolling rather than usefulness. Anything longer than the track can be stepped along in stages, marking where you finished and sliding the object down. If you need a genuinely long straight measurement, a tape measure is the right instrument and this is not competing with it.

Does the inch scale go down to sixteenths?

No, it is drawn at eighth-inch granularity, which works out at 97 tick marks over twelve inches, with a labelled tick at every whole inch and a taller unlabelled one at each half. If you need a finer division than an eighth, switch the toolbar to mm, where every single millimetre gets its own tick. A millimetre is finer than a sixteenth of an inch, which is just under 1.6 mm.

Is the drag readout more precise than counting tick marks?

It is more precise to read, not more accurate. Both come from the same calibrated pixels-per-millimetre figure, so both inherit whatever error your calibration had. What the readout adds is decimals, one for mm and cm and three for inches, instead of you eyeballing where a mark falls between two ticks.

Related tools