Online ruler

An actual size ruler for any screen: calibrate once with a bank card, a UK coin or the screen size, then measure in cm, mm and inches, or print one.

This ruler online shows centimetres, millimetres and inches. Until it is calibrated it uses the browser standard of 96 pixels to the inch, which is rarely real size. Matching an outline once to a bank card, a coin, a banknote, a sheet of A4 or the screen's own size makes it actual size, saved in this browser.

Not calibrated yet: the ruler uses the browser standard of 96 pixels to the inch, which is rarely real size. Calibrate it once with a card, a coin or your screen size.

On this screen 1 cm is 37.8 page pixels.

Hold the object flat against the screen with one end on the 0 mark and read the other end.

Prints rulers 18 cm and 7 inches long, with a check square and a card outline. Print at 100% (actual size), never fit to page.

An actual size ruler for the screen of a phone, tablet or computer, set up for the UK: centimetres with millimetre marks above inches to the sixteenth. It also measures between two points, draws any length, fills the screen edge to edge and prints a paper copy.

Why a screen ruler starts out wrong

A web page cannot ask the screen how large its pixels are. Browsers lay pages out in CSS pixels, and the W3C's CSS Values and Units module fixes the inch at a set number of them. The same text warns that on screens these units might not match their physical measurements. Real pixel density, counted in pixels per inch, varies from screen to screen, so an uncalibrated centimetre is a guess.

A 24 inch Full HD monitor shows the size of that guess. Its 1,920 by 1,080 pixels on a 24 inch diagonal give a pixel density of 91.79, or 36.1 pixels to the centimetre. The CSS standard assumes 37.8. On that monitor a 10 cm line drawn at the standard really measures 10.5 cm, about 5% too long.

Phones and sharp laptop screens add a second layer. There the browser groups several physical pixels into each CSS pixel, and the devicePixelRatio says how many. Neither figure tells the page how many millimetres the screen spans. That is why the ruler needs calibration: one comparison with an object of known size, after which it draws real centimetres on that screen.

Calibrating against a bank card

Every bank card, debit card and credit card is made to one format, which the ISO/IEC 7810 standard calls ID-1. ICAO's Doc 9303 gives its nominal size as 85.6 × 53.98 mm, with corners rounded to a radius of 3.18 mm. The UK photocard driving licence uses the same format, so it works just as well.

To set the scale, Calibrate opens the calibration panel, where the card is one of six methods. The card is held flat against the glass over the drawn outline, which has the card's rounded corners. On a screen too narrow for it, the outline stands upright. A slider, or the minus and plus buttons, makes the outline larger or smaller in steps of a tenth of a page pixel per centimetre.

When the card's edges meet the outline all the way round, Save the calibration stores the result. Every view then uses it: the ruler, the measuring line and the length bar. A note under the ruler gives the date and the method, and Calibrate again starts over. The match is the main limit, since the ruler can never be more exact than an eye lining up an edge.

UK coins and banknotes as the yardstick

The 1p coin measures 20.3 mm across, going by the Royal Mint's coin specifications. The coin method offers seven coins, from the 5p at 18 mm to the £2 at 28.4 mm, and starts on the £2.

Coins the ruler can be calibrated with
CoinDiameterShape
1p20.3 mmRound
2p25.9 mmRound
5p18 mmRound
10p24.5 mmRound
20p21.4 mmSeven curved sides, constant width
50p27.3 mmSeven curved sides, constant width
£228.4 mmRound

The 20p and 50p have seven sides, but each side is a curve, so the coin is the same width whichever way it is measured. The Royal Mint calls the shape an equilateral curve heptagon. The ruler draws that curved outline, so the diameter can be matched in any position. A coin on a screen stays put more easily with the screen tilted back.

The twelve-sided £1 coin is not offered. The Royal Mint and the 2016 proclamation that introduced it give two different figures for its size, and neither says where across the twelve sides the figure is taken.

Bank of England polymer notes are the largest option. The £5 note is approximately 125 × 65 mm, in the Bank's own word. Each higher value is longer and taller, up to the £50 at 146 × 77 mm. A note wider than the screen is drawn upright. Because the Bank gives only approximate sizes, a card is the tighter reference of the two.

How many pixels are in a centimetre?

It depends on the screen: pixels per inch divided by 2.54 cm gives pixels per centimetre. An iPhone 17 has about 181.2 in each centimetre, a 24 inch desktop screen at Full HD about 36.1.

Pixel density comes from two figures in a maker's specification: the screen diagonal and the resolution. The diagonal in pixels is the square root of the width squared plus the height squared. Dividing it by the diagonal in inches gives the density. The screen size method does this sum, and a known density then sets the ruler without any object.

Apple lists the iPhone 17 at 2,622 by 1,206 pixels on a screen of 6.27 inches measured as a rectangle. The formula gives 460.3, which Apple rounds to 460 ppi. The picture is then 14.5 cm by 6.7 cm, and a single pixel is 0.055 mm wide.

Rounded diagonals change the answer. Apple sells the same phone as a 6.3 inch model, and that figure gives 458 ppi instead of 460. The field accepts diagonals from 3 to 100 inches.

Detect the resolution fills in the resolution the browser reports. Some browsers report the window rather than the whole screen, so the maker's specification is the safer figure. The reference cases check the formula against Apple's published density and two monitors.

Pixel density of three screens
ScreenPixels per inchPixels per cmOne pixel
iPhone 17, 2,622 by 1,206460.3181.20.055 mm
24 inch monitor, 1,920 by 1,08091.7936.10.277 mm
27 inch monitor, 2,560 by 1,440108.7942.80.233 mm

Reading centimetres and inches side by side

The UK page shows both scales at once: centimetres along the top edge and inches along the bottom. Scale switches to centimetres only or inches only. On the cm ruler each centimetre is split into ten millimetre steps, with a longer mark at the half.

The inch scale has five lengths of mark. The longest stands at each whole inch, then come the half, the quarter and the eighth, and the shortest marks the sixteenths. An object 7 cm long reaches 2.76 inches, which the inch scale shows as 2 3/4, its nearest sixteenth.

The conversion is fixed by law. Schedule 1 of the Weights and Measures Act 1985 defines the inch as one thirty-sixth of a yard, which makes it exactly 25.4 mm. In schools, the Department for Education's National Curriculum has Year 5 pupils use approximate equivalences between metric measures and common imperial units such as inches.

Can I use my phone as a ruler?

Yes, once it has been calibrated, and a card fits on almost any phone screen for that. Full screen ruler then puts zero at the very edge of the glass and runs the scale along the long side, upright while the phone is held upright.

Turn swings the scale round for a phone or tablet lying on its side. Where the browser allows it, the ruler takes the real full screen, hiding the address bar. Safari on iPhone does not offer that for pages, so there the ruler covers the page instead, which works the same way.

For a small object, one end goes on the zero mark and the other end is read off the scale. Holding it flat against the glass, rather than above it, avoids reading the scale at an angle.

Measuring between two points

The Measure view turns the screen into a measuring line with two points that can be dragged anywhere. It gives the length in cm, mm and inches with the nearest sixteenth, plus the distance across and up and down. It also shows the area of the box between the points and the angle from the horizontal, from 0 to 180 degrees.

On a keyboard, a selected point moves one page pixel per arrow key press, or one millimetre with Shift held. A printed passport photo is a good test. GOV.UK asks for a photo 45 mm high and 35 mm wide, with the head 29 to 34 mm from crown to chin. The line checks all three on a photo laid on the glass.

Show a length works the other way round. It draws a length from 0.5 mm up to 100 cm as a bar with a ruler beneath it. The length can be typed in millimetres, centimetres or inches, and the other units are shown alongside. A bar longer than the space says so. The line measures only what lies on the screen or appears there at real size: it cannot scale an object shown in a photograph.

A printable ruler for A4 paper

Print a ruler produces a sheet with two rulers, 18 cm and 7 inches long, a check square of 5 cm a side and a card outline. Both rulers fit across A4 paper, which is 21 cm wide, with room for the margins.

The printable ruler does not depend on the screen calibration, because printers keep CSS millimetres, but only at a scale of 100%, often called actual size. A print dialogue set to fit to page may shrink the sheet to fit the paper, and the ruler with it. No printer scale can be guaranteed from a web page.

The check square shows whether the sheet came out true: each side should measure 5 cm against a trusted ruler. A payment card laid on the printed outline should cover it exactly, which gives a second check without any ruler at all.

Zoom, saved settings and how close it gets

This browser's local storage keeps the saved setting, together with the page zoom it was made at, the method and the date. Forget the calibration removes it. Another browser, another device or cleared site data starts without one, and nothing measured is stored or sent anywhere.

Browser zoom is allowed for. A saved scale of 40 page pixels per centimetre at 100% zoom becomes 32 at 125%, since each page pixel then covers more of the screen. The ruler says when it has adjusted. Pinch zoom on a phone is different: the page asks for it to be undone before measuring.

Each method carries its own tolerance. ICAO allows ID-1 cards to differ from the nominal size by less than a millimetre on each side. The Bank of England describes its note sizes as approximate. Lining up an outline by eye adds its own small error, so the reading is as exact as the match behind it.

Frequently asked questions

Is a ruler on screen accurate?

Only after calibration. Before it, the ruler follows the browser standard of 96 pixels to the inch. On a 24 inch monitor at Full HD, that turns 10 cm into 10.5 cm. Once matched to a card, a coin or the screen size, it is as exact as the match.

Why does the same ruler look a different size on each screen?

Screens pack their pixels at different densities, and browsers do not know the physical size of a pixel. A phone may have several times as many pixels in a centimetre as a desktop monitor, so the same number of pixels covers a different length.

What if the object is longer than my screen?

The full screen ruler gives the most length, and an object can be measured in parts by marking where each stretch ends. The printed 18 cm ruler is another route. Garden distances, such as a hedge's height or its gap from the boundary, need a tape measure, and the high hedge checker works from those figures.

How big is 1 cm?

One centimetre is 10 mm, or about 0.39 inches, close to 3/8 of an inch. After calibration, the Show a length view draws it at real size, and any other length from 0.5 mm upwards.

What size is a credit card in cm?

A credit card is 8.56 cm by 5.398 cm, the ID-1 size shared with debit cards and the photocard driving licence. In inches that is about 3.37 by 2.125.

Does the calibration stay after I close the browser?

Yes. It stays in that browser on that device until Forget the calibration is pressed or the site's data is cleared. Another browser, a private window or a different device needs its own calibration.

Can I measure my ring size with it?

The ruler has no ring size scale. Its measuring line gives the distance across a ring laid flat on the glass, in millimetres. Turning that into a ring size takes a jeweller's chart, which this tool does not include.

Does it use my phone's camera?

No. The ruler is drawn on the display and the object is held against it. Camera measuring apps work out sizes from the picture, which is a different method that this page does not use.

Checked against known answers

Each case below has an answer fixed by its source or worked by hand from it. The tool computes it on every build, and a page that stops matching is not published.

Sources

The figures and rules on this page were checked against these publications on .

Related tools