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, Ctrl+V to paste, oror
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.
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.