DEV Community

Cover image for No Ruler? Your Wallet Is Already a Precision Measuring Tool
keyboardTester.Click
keyboardTester.Click

Posted on • Originally published at keyboardtester.click

No Ruler? Your Wallet Is Already a Precision Measuring Tool

You need to measure something right now - a parcel, a screw, the gap a cable has to fit through - and the one drawer that should hold a ruler doesn't. Here's the useful part: the things already in your pocket are manufactured to published standard sizes, which makes them measuring references you can trust.

I wrote the full guide (coins table, paper sizes, phone AR accuracy, the on-screen ruler math) here:

How to Measure Without a Ruler: 8 Accurate Methods

This is the compact developer-friendly version.

The one number worth memorizing: 85.6 mm

Every payment card on Earth follows ISO/IEC 7810, format ID-1. Credit cards, debit cards, most national IDs and hotel key cards are all exactly:

85.6 mm x 53.98 mm (3.370 x 2.125 in), ~0.76 mm thick, ~3 mm corner radius.

That makes any wallet a certified gauge. The long edge is a touch over 8.5 cm; the diagonal is about 101 mm (basically 10 cm). To measure with it, count in card units and mark each step with a fingernail: an object two card-lengths long is ~171 mm. Two stacked cards (~1.5 mm) even work as a feeler gauge.

The card matters for a second reason: it's the reference that lets you calibrate a screen ruler - more on that below.

The reference stack, from exact to rough

Reference Size Good for
Bank card (ISO ID-1) 85.6 x 53.98 mm Calibrating everything; objects under ~9 cm
US quarter 24.26 mm A hair under 1 inch
US penny 19.05 mm Exactly 0.75 in across
€2 coin 25.75 mm ~1 inch
Any US bill 156 x 66.3 mm Mid-range lengths
A4 paper 210 x 297 mm Short edge is exactly 21 cm
Adult thumb ~1 in / 2.5 cm The literal "rule of thumb" - calibrate yours once

Coins are minted to tight tolerances and wear at the design, not the rim, so old coins still measure true. Line four US quarters edge to edge and you get ~97 mm.

The developer-relevant part: "1 cm actual size" is a lie without calibration

If you've ever built a UI and reached for physical units, you already know the trap. CSS defines absolute lengths against an assumed 96 pixels per inch - a number inherited from 1990s desktop displays. Real panels range from ~92 PPI (a 24" 1080p monitor) to 160+ (laptops) to 350-500+ (phones).

So a width: 1cm box is over 2.5 cm on that office monitor and well under 1 cm on a phone. No web page can render a true centimeter on every screen without measuring the display first. Any "actual size ruler" that skips calibration is guessing.

The fix is to derive the ruler from a measured pixelsPerMm instead of a fixed pixel count:

// Card overlay is dragged until it matches a real ISO ID-1 card held to the screen.
// cardWidthPx = on-screen width the user matched to the physical card.
const CARD_MM = 85.6;
const pixelsPerMm = cardWidthPx / CARD_MM;

// Now 1 cm is honest on THIS display:
const oneCmPx = pixelsPerMm * 10;
Enter fullscreen mode Exit fullscreen mode

Store pixelsPerMm in localStorage, and recalibrate whenever browser zoom, the monitor, or OS display scaling changes - each of those changes how many physical pixels a CSS pixel covers.

That's exactly what the free on-screen ruler on our site does: hold a card to the glass, drag until the outline matches, and it reads true to about ±0.5 mm for your specific display - in cm or inches, no install.

Phone AR apps: fine for furniture, wrong for screws

Apple's Measure app and ARCore-based Android apps lay virtual tape over the camera feed. Treat the output as an estimate: roughly 3-5% error in good light on textured surfaces (a 2 m sofa reads 1.94-2.06 m). Great for rooms and boxes, useless for a 12 mm thread. Measure a span two or three times and only trust it when the attempts agree.

Printable rulers: only at 100% scale

PDF rulers work on one non-negotiable condition: the print dialog must be 100% / actual size. "Fit to page" silently rescales by several percent, and a ruler that's 5-10% short is worse than none. Verify every printout by laying a card on it - if the card doesn't read 85.6 mm, reprint.

TL;DR

  1. Grab any bank card - it's exactly 85.6 x 53.98 mm, everywhere.
  2. Coins and A4 paper cover the sizes a card is too short for.
  3. Phone AR is an estimate (~3-5%); printable rulers only work at verified 100%.
  4. For real cm/mm precision, calibrate a screen ruler with the card once - it's accurate to about half a millimeter.

Same first-principles trick shows up elsewhere in hardware: measuring your actual mouse DPI is the same idea - move a known distance, count what the sensor reports, calculate the truth.

Full version with the complete coin/paper tables, the photo-ratio scaling trick and the accuracy breakdown: How to Measure Without a Ruler: 8 Accurate Methods

Top comments (0)