- Home
- Measurement Guides
- How to Measure an Object in a Photo
How to Measure an Object in a Photo
Set a scale with a reference object, keep everything in one plane, shoot square to the subject, and know when a photo measurement should not be trusted
·
The idea: one known length sets the scale
A photograph has no built-in units. Its pixels only become millimeters when something in the frame has a length you already know. That object is the reference, and the ratio of its pixel length to its real length is the scale for the whole image:
scale (px per mm) = reference length in pixels / reference length in mm
object length (mm) = object length in pixels / scaleIf an ISO/IEC 7810 ID-1 card, which measures 85.60 × 53.98 mm, spans 856 pixels in a photo, the scale is 856 / 85.6 = 10 px per mm. An object that spans 1,234 pixels in the same photo is then 123.4 mm long.
The image measurement tool follows this sequence: load a photo, draw a line along the reference and enter its real length, then draw lines along anything else and read the result.
Try the built-in teaching example
Choose Try example image in the empty state. The original SVG labels a blue 100 mm reference, an orange 80 mm edge, and a purple right angle. Select Recalibrate, place the two endpoints at the centers of the blue markers, and enter 100 mm. Before a length scale is applied, length results are image pixels; afterward the orange edge can be read in physical units. Angle measurement is independent of the length scale.
Endpoints remain draggable, and Export PNG creates a local annotated copy. Loading the example over existing work requires confirmation because it clears that image and its marks. The example is a workflow lesson, not an actual-size reference or evidence of physical accuracy. Keep reference and object in one plane and photograph straight-on: the tool does not correct perspective.
Choosing a reference
Any object with a standard or verified dimension works. Larger is better, because the same pixel error is a smaller fraction of a longer line.
| Reference | Known dimension | Notes |
|---|---|---|
| ID-1 card (bank, ID, loyalty) | 85.60 × 53.98 mm | Standardized worldwide; use the long edge |
| A4 sheet | 297 × 210 mm | Large and flat; keep it uncreased |
| Physical ruler or tape | Printed marks | Read two marks far apart, not the ends |
| Floor or wall tile | Measure one first | Nominal sizes are often rounded |
For a tile or any object without a published standard, measure it once against the calibrated centimeter ruler or a tape before using it. If the reference is known in inches, the unit converter gives millimeters at exactly 25.4 mm per inch.
The same-plane rule
A scale computed from the reference is valid only for objects that lie in the same plane as the reference and face the camera squarely. In the pinhole camera model, apparent size is inversely proportional to distance: an object 10% closer to the lens than the reference appears about 10% larger than the scale predicts.
This is the largest source of error in photo measurement, and it is invisible in the image. A card placed on top of a box is fine, because the card and the box's top face share a plane. A card placed on the table beside the box is not, because the box's top is closer to the camera. To measure several objects, lay them flat on one surface with the reference among them and shoot straight down.
Shooting tips
- Hold the camera square to the surface. For a tabletop, shoot straight down; for a wall, stand directly in front of it at the object's height.
- Put the object and the reference near the center of the frame. Lens distortion grows toward the edges, so the middle of the image is the most faithful region.
- Step back and zoom in rather than moving close. A longer focal length flattens perspective and reduces distortion. Avoid a phone's ultra-wide camera.
- Use good light, a steady grip, and full resolution. Blurry edges make endpoints hard to place, and more pixels across the reference means a smaller fractional error for each pixel of endpoint placement.
- Keep the reference flat and fully visible. A curled card or a partially hidden edge cannot be measured to its true length.
How perspective and lens distortion add error
Perspective foreshortening. When the surface tilts away from the camera, distances that recede look shorter than distances that run across the frame, and a square becomes a trapezoid. A reference along the wide edge and an object along the narrow edge gives a reading that is too small even though both are in the same plane.
Barrel distortion. Wide-angle lenses bow straight lines outward, more strongly toward the edges of the frame. A straight edge near the border can read longer or shorter than it would in the center, and the effect differs by lens, so no single factor corrects it.
Reference error propagates proportionally. Whatever fraction of the reference length you get wrong, every measurement inherits. If the endpoints of an 85.6 mm card are placed 2 mm short, the scale is off by 2 / 85.6 = 2.3%, and a 500 mm object measured with that scale is off by about 11.7 mm. The same 2 mm error on a 297 mm A4 edge gives only 0.7%.
Two quick self-checks: after setting the scale from the card's long edge, measure its short edge and confirm it reads close to 53.98 mm; then measure something else of known size elsewhere in the frame. Disagreement means the plane is tilted or the lens is distorting.
Measuring angles
The tool also measures the angle between two lines. Angles need no scale, since they depend only on direction, but they obey the same plane rule. A right angle on a surface parallel to the sensor appears as 90°; on a tilted surface, perspective skews it, and a rectangle's corners read as two acute and two obtuse angles.
A card corner is a convenient test. If it reads close to 90°, the surface is square to the camera. If it reads 80° or 100°, retake the photo before trusting any length.
When not to trust a photo measurement
Photo measurement suits estimates such as whether a shelf fits an alcove. It is not a substitute for a physical instrument when the number carries consequences, including custom or non-returnable purchases.
- Safety and engineering. Clearances, load-bearing spans, and parts that must fit within a tolerance need a tape, caliper, or gauge.
- Legal and property matters. Boundaries, evidence, and anything that might be disputed need a surveyed or witnessed measurement.
The accuracy page explains why the site treats photo measurement and on-screen measurement differently, and the methodology describes what the tool computes and what it does not.
Privacy: the image stays on your device
The image measurement tool runs entirely in your browser. The photo is decoded and drawn on a canvas on your own device, the lines and lengths you enter are handled by local JavaScript, and nothing is uploaded to a server. Closing the tab discards the image; loading a photo with your network connection switched off works the same way.
More guides
A4 Paper Size in Pixels at 72, 96, 150 and 300 DPI
A4 is 210 × 297 mm; here is its size in pixels at every common DPI, the formula behind it, A3 and A5 values, and a US Letter comparison
Read guideHow to Calibrate an Online Ruler
Calibrate a browser screen ruler with a bank card or your display diagonal, verify the result, and learn what makes the calibration go stale
Read guideWhy Browser Zoom Breaks an Actual-Size Ruler
See how page zoom and pinch zoom rescale CSS pixels, how to detect the change through devicePixelRatio, and a checklist to restore an actual-size ruler
Read guide