Pixel Ruler

Click two points on an image to measure the distance between them, or three points to measure the angle. Distances are in the image's own pixels; enter a DPI and you also get centimetres or inches.

Drag & drop a file here, or

JPG PNG WebP GIF Max 50MB

In the image's own pixels

The preview is scaled to fit your screen, but every click is mapped back to the image's real pixel grid before anything is measured. So the distance you read is the picture's own pixels, not the smaller number of screen pixels the preview happens to occupy — the same on a phone and a wide monitor.

Centimetres need a DPI

An image file has no physical size on its own — a pixel is only a real distance once you say how many pixels make an inch. So cm and inches appear only when you type a DPI, and the readout keeps the pixel figure and the DPI beside the result. We never quietly read a resolution out of the file and treat it as fact.

100% private

Your image never leaves your device. It is drawn on the Canvas API in your browser and every measurement is computed locally from where you click. No upload, no storage, no account.

Advertisement

How it works

Screen pixels are not image pixels

The picture you click on has been scaled to fit the column it sits in — a two-thousand-pixel photo might be shown four hundred pixels wide on a phone. If a ruler measured the click exactly where it landed on screen, it would report that smaller, screen-shaped number and call it the image's, and the answer would change every time the browser window did. This tool never does that. The moment you click, the position is mapped back through the ratio of the image's true width to its displayed width, so the point is recorded in the picture's own pixel grid. The number under the preview is therefore the same whether you measured on a laptop or a phone, and the method line states the native dimensions it is counting in.

Why centimetres need a DPI

A pixel is a count, not a length. Two hundred pixels is two inches at one hundred DPI and about two thirds of an inch at three hundred, so a distance in pixels only becomes a distance in centimetres once you say how many pixels make an inch. That is why a real-world unit is greyed out here until you type a DPI: without one, the tool has nothing to convert against and will not invent it. A JPEG can carry a DPI in its metadata, but that field is a claim the file makes about how it was meant to be printed, not a fact about your screen or your subject — so this tool does not silently adopt it. When you do enter a resolution, the readout keeps the pixel figure and prints the DPI it used next to the converted number, so the assumption behind the centimetres is always visible and checkable.

Distance, bearing and angle

Distance mode takes two points and gives the straight-line length between them, along with the horizontal and vertical gaps and the segment's bearing. Because image coordinates run downward, that bearing is stated as an angle measured clockwise from the horizontal in the image's own orientation, rather than left for you to guess which way it leans. Angle mode takes three points and reports the angle at the middle one — the corner between the two arms — which is a plain interior angle between zero and a hundred and eighty degrees and needs no convention at all. Nothing here is rounded past what a click can support: a mouse or a fingertip does not land on an exact pixel, so coordinates are given to the nearest whole pixel and the result is click-accurate, not sub-pixel precision the input never had.

Where it runs, and what it is not

Everything happens in your browser through the Canvas API. The image is never uploaded, nothing is stored, and no account is needed. One thing this is deliberately not: a way to recover the real size of something photographed at an unknown distance. A ruler on a flat scan is exact, but a photograph is a projection — objects further from the camera cover fewer pixels — so pixels measured on a snapshot do not convert cleanly to real lengths unless there is a known scale in the same plane. For print sizing and DPI questions on a whole image see the DPI Converter and Print Readiness Scanner; to change pixel dimensions see the Image Resizer.

Frequently Asked Questions

How do I measure a distance on an image?

Upload your image, leave the mode on Distance, and click two points on the picture. The tool draws a line between them and reports the straight-line length in pixels, along with the horizontal and vertical gaps and the segment's bearing. Click a third point and it starts a fresh pair, or use Clear points to start over. The measurement is taken in the image's own pixels, not the smaller screen pixels the preview occupies.

Are the measurements in real pixels or screen pixels?

Real image pixels. The preview is scaled to fit the page, so where you click is a screen position that is smaller than the picture. Before measuring, the tool maps that click back through the ratio of the image's true width to its displayed width, so the point is recorded on the image's native pixel grid. The result is therefore the same on a phone and on a wide monitor, and the line under the readout prints the native dimensions the numbers are counted in.

How do I get centimetres or inches instead of pixels?

Type a DPI in the resolution box and the centimetre, millimetre and inch options become selectable. A pixel is only a real length once you say how many pixels make an inch, so a real-world unit stays disabled until a DPI is entered. When it is set, the readout shows the converted figure and keeps the pixel count and the DPI it used beside it, so you can always see the assumption the conversion rests on.

Why do I have to enter the DPI myself — can't you read it from the file?

A DPI stored in a file is a note about how the image was intended to be printed, not a measured fact about your subject or your screen, and it is often just a default like 72 or 96 that has nothing to do with the real scale. Adopting that number silently would make the centimetres look authoritative while resting on a guess. So the tool asks you for the resolution and prints it next to the result, rather than reading one from the metadata and treating it as truth. If you want to inspect or change the DPI a file declares, use the DPI Converter.

How is the angle measured?

Switch the mode to Angle and click three points. The middle point is the vertex, and the tool reports the angle between the two arms meeting there — a plain interior angle between zero and a hundred and eighty degrees. That figure is orientation-free, so it needs no convention about which way is up. It also shows the length of each arm, so you can check you clicked where you meant to.

What does the bearing mean?

In Distance mode the bearing is the direction of the segment from the first point to the second, given as an angle from the horizontal. Because image coordinates increase downward, the angle is stated as measured clockwise from the horizontal in the image's own orientation: zero degrees points right, ninety points straight down the picture, a hundred and eighty points left. Stating the convention is the point — an unlabelled angle leaves you guessing whether it leans up or down.

How precise is a click?

As precise as a mouse or a fingertip, which is not to the exact pixel. The tool records each point to the nearest whole pixel and reports lengths to one decimal, rather than printing three decimals that would imply a precision the click never had. For pixel-exact work — say, checking that a logo is exactly two hundred pixels wide — zoom your browser in so each image pixel covers more screen before you click.

Can I measure the real-world size of an object in a photo?

Only with care. A flat scan or a screenshot measures cleanly, because every pixel covers the same real distance. A photograph is a projection: things nearer the camera cover more pixels than things further away, so a pixel length does not convert to a real length unless there is a known reference of the same size sitting in the same plane as your subject. The tool measures the image faithfully; turning that into centimetres of a real object is a judgement about the scene that only you can make.

Does this upload my image anywhere?

No. The image is drawn into a canvas in your browser, and every distance and angle is computed locally from where you click. Nothing is sent to a server, nothing is stored, and no account is required.

How is this different from the DPI Converter or Image Resizer?

This tool measures parts of an image — the gap between two points, or the angle at a corner — and changes nothing. The DPI Converter reads and rewrites the print resolution a whole file declares, and the Image Resizer changes the pixel dimensions of the whole image. Use the ruler to find out how far apart or at what angle two things are; use the other two to change how the image is described or sized.