Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Everyday tools

On-screen ruler

An on-screen ruler only shows real centimeters or inches once it knows your screen's pixel density. Hold a bank card against the screen and match the outline to it, or type your screen size, and the ruler below is drawn at true size in cm and mm or in inches down to 1/16.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Calibrate with
Units
On-screen ruler

Not calibratedSizes follow the CSS inch (96 px), which is rarely a real inch. Calibrate first.

01234567cm
  • Scale 3.78 px per mm

Put the object against the screen at the 0 mark. Keep the page at 100% zoom: zooming changes the scale.

How to use the On-Screen Ruler

  1. Under Calibrate with, pick A bank card or Screen size.
  2. For a card, hold it flat against the screen and move the slider until the dashed outline is exactly as wide as the card.
  3. For screen size, type the diagonal in inches from the spec sheet. Keep the browser at 100% zoom.
  4. Pick cm or inches and place the object at the 0 mark. Type a length under Show a length to draw a bar of that size.

How do I use a ruler on my screen?

Calibrate it first, then hold the object against the glass at the 0 mark and read the scale. Calibration matters because a screen does not know its own physical size. A browser draws everything in CSS pixels, and the CSS standard defines an inch as 96 of them, while warning that on screens the physical units might not match their real measurements. A real screen packs its pixels more or less densely, so an uncalibrated ruler is almost always the wrong length.

The card method works on any device. Bank cards, ID cards and most loyalty cards share one standard size, called ID-1: 85.60 mm by 53.98 mm. ICAO's travel-document standard quotes these figures from ISO/IEC 7810. Drag the slider until the dashed outline matches the card's width, and the page works out how many pixels make a millimetre.

Bank, ID and membership cards are usually this size, but not every card is. A card that looks smaller or larger than the others in your wallet is probably a different format, so if you are not sure, check its width against a real ruler before you use it to calibrate.

The calibration is saved in this browser, so the ruler stays true the next time you open it on the same device. Calibrate again if you change the zoom level, plug in another monitor or use a different browser.

What the CSS standard assumes (uncalibrated)
LengthCSS pixelsReal size it is meant to be
1 CSS inch96 px2.54 cm
1 CSS cm37.80 px0.394 in
ID-1 card width323.5 px85.60 mm
ID-1 card height204.0 px53.98 mm

How does the screen size method work?

It works out the pixel density from the screen's diagonal and its pixel count. A browser reports the screen's width and height in CSS pixels and the device pixel ratio, the number of physical pixels behind each CSS pixel. Multiply to get the real pixel count, find the diagonal in pixels with Pythagoras, and divide by the diagonal in inches. That is the screen's pixels per inch.

A 15.6 inch laptop at 1920 × 1080 works out at about 55.60 CSS pixels per cm, close to the CSS assumption. A 6.1 inch phone reporting 390 × 844 CSS pixels at a ratio of 3 gives 60.01 CSS pixels per cm, a long way from it. The table shows a few more cases.

Phones differ so much because they draw each CSS pixel with several device pixels to keep text readable. A phone may report 390 CSS pixels across a screen that is 1,170 pixels wide. The ratio between the two is what the browser reports as the device pixel ratio, and it is the reason the card method is the safer choice on a phone.

This method needs the browser to report the screen correctly, which it does at 100% zoom with the display at its normal scaling. If the result looks off against a real ruler, use the card method: it measures the screen directly and does not rely on what the system reports.

Screen size calibration for some example screens
ScreenDiagonalCSS size and pixel ratioPixels per inchCSS px per cm
Laptop15.6 in1920 × 1080 at 1x14155.60 px
Laptop, scaled13.3 in1280 × 800 at 2x22744.68 px
Monitor27 in2560 × 1440 at 1x10942.83 px
Phone6.1 in390 × 844 at 3x45760.01 px
Tablet11 in834 × 1194 at 2x26552.13 px

How accurate is an on-screen ruler?

With a careful card calibration it is accurate to about a millimetre over the length of the ruler. The limit is how well you can match the outline to the card by eye: half a pixel at each end. At 323.5 pixels for 85.60 mm, one pixel is about a quarter of a millimetre on a screen at the CSS density, and less on a sharper screen.

Measure flat objects held against the glass. Anything thick sits away from the pixels, and viewing it at an angle shifts where its edge appears. Look straight at the screen, close one eye if it helps, and line up one edge with 0 before you read the other.

The ruler fits the width of its panel. For longer objects, measure in steps and add them up, or use a tape measure. The panel shows how long its ruler is on your screen, so you know how much fits.

The tick marks sit at fractional pixel positions, so on a low-density screen some millimetre marks look a little thicker or thinner than others. That is the screen rounding each line to its nearest pixel. Read the centimetre and half-centimetre marks, which are longer, when you need the best accuracy.

What can I measure with it?

Small flat things are what it is for: a coin, a screw, a photo print, a ring laid flat, the width of a cable, a seed, a label. It is useful when no ruler is at hand or when you need to check a size against a product listing.

Show a length turns the job round. Type 5 cm or 2 inches and the page draws a bar exactly that long, so you can check whether something you plan to buy will fit, or see how big a stated size really is.

To check the calibration itself, measure something of known size. A second card should match the outline exactly. If it does not, move the slider a little and check again.

If you know your screen's diagonal and resolution, the PPI calculator gives its pixel density in pixels per inch: the same figure the screen size method works out here from what the browser reports.

For sizes on paper rather than on screen, the paper sizes reference lists A4, Letter and other formats, and the inches to pixels converter turns physical sizes into pixels for printing and design.

Use it with

Questions

How do I measure something on my screen in cm?

Calibrate the ruler with a bank card or your screen size, choose cm, and place the object against the screen at 0.

Why is my on-screen ruler the wrong size?

It is not calibrated. Browsers assume 96 pixels per inch, which rarely matches a real screen. Calibrate with a card.

How big is a credit card in cm?

8.56 cm by 5.398 cm: the ID-1 size of 85.60 mm by 53.98 mm used by bank cards and ID cards.

Can I use my phone as a ruler?

Yes, after calibrating. Match the card outline on the phone, then lay small objects on the screen.

How many pixels are in a centimeter on a screen?

In CSS terms 37.80, but the real number depends on the screen. A card calibration measures it: a card outline 323.5 px wide gives 37.79 px per cm.

Does the ruler stay calibrated?

Yes, on the same device and browser. The calibration is kept in this browser only and is not sent anywhere.

The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.