ThisCalculator

Sports and fitness

Calculate Focal Length From an Image: Formula and Example

Updated · Standard formula, shown below

Focal length 100.00 mm
Image distance
500.00 mm
Result
Object size
100 mm
You entered
Image size
20 mm
You entered

Calculate Focal Length From an Image: Formula and Example

To calculate focal length from an image, use the image size, the object’s real size, and its distance from the lens: for a thin lens, f = uv/(u + v), where u is object distance and v is image distance. This calculator instead uses the magnification relationship to find focal length from those three measured values; enter object size, image size, and object distance to get focal length and the implied image distance.

Formula

For a thin lens forming a real image, magnification in absolute size is m = image size / object size = v / u, and the thin-lens equation is 1/f = 1/u + 1/v. Combining these gives:

f = u / (1 + object size / image size)

  • f is focal length, in the same length unit as the distances.
  • u is the distance from the object to the lens’s principal plane.
  • v is the distance from the lens’s principal plane to the image plane.
  • Object size and image size are corresponding dimensions measured in the same unit, such as object height and image height.

The calculator’s second result uses v = u × image size / object size. All entered lengths can be millimetres, centimetres, inches, or another consistent unit; the focal length result uses that same unit. This form assumes a real, inverted image and uses positive distances as magnitudes.

Worked Example

Use the calculator’s defaults: object size = 100 mm, image size = 20 mm, and object distance u = 600 mm.

  1. Find the image-to-object size ratio: 20 mm / 100 mm = 0.20.
  2. Calculate focal length: f = 600 mm / (1 + 100 mm / 20 mm) = 600 / 6 = 100.00 mm.
  3. Calculate image distance: v = f × (object size / image size) = 100 × (100 / 20) = 500.00 mm.

The image is one-fifth the object’s height, so its distance from the lens is five times the object distance’s magnification counterpart: v/u = 0.2. The thin-lens equation also checks: 1/100 = 1/600 + 1/500, with distances in millimetres.

How to Measure an Image and Object

“Image” can mean a physical image made on a screen or a photograph of a scene. For the lens equation, image size means the size of the image formed by the lens at its image plane—not the pixel dimensions of a saved photo by themselves. A digital image’s pixel width does not reveal focal length unless the scene dimensions, camera geometry, sensor information, or another scale reference is known.

For a practical measurement, place a known-size object in front of a lens and form a sharp image on a screen. Measure the object and its projected image along the same direction, such as both heights. Measure object distance from the lens’s principal plane to the object and image distance from that plane to the screen. With simple thin lenses, the principal plane is often approximated by the lens’s center, but real multi-element lenses can have principal planes inside or outside the lens assembly.

For example, if a 10 cm object forms a 2 cm image, the absolute magnification is 0.2. If the object is 60 cm from the lens, the calculator gives f = 10 cm and v = 50 cm. If you enter centimetres, read the focal length in centimetres; convert to millimetres by multiplying by 10.

When This Calculation Works

The method is useful for estimating the focal length of a simple lens from a measured object-image setup, checking a classroom optics experiment, or understanding how magnification relates to lens geometry. It relies on the paraxial thin-lens model: rays are close to the optical axis, the lens is treated as thin, and distances are measured from appropriate principal planes.

For a real image produced by a converging lens, the object and image are on opposite sides of the lens. A diverging lens generally produces a virtual image for a real object; the signed-distance lens equation must then be used, rather than treating all distances as positive magnitudes. Similarly, if the image is virtual or the lens system is thick, the simple calculator’s assumptions may not apply directly.

Common Errors and Limits

  • Mixing units: Keep object size, image size, and object distance in consistent units. A 10 cm object entered as 10 alongside an image size of 20 mm corrupts the ratio.
  • Measuring the wrong image: Use the projected image formed by the lens, not a digital file’s width or a screen’s full dimensions.
  • Using non-corresponding dimensions: Compare width with width or height with height, and measure through the same orientation.
  • Measuring from the wrong point: The equation uses distances from the lens’s principal planes. The lens housing or front glass may not mark those positions accurately.
  • Rounding too early: Keep extra digits through intermediate steps, then round the final focal length to a precision justified by your measurements.
  • Ignoring measurement uncertainty: Small errors in a short image size or distance can noticeably alter the result. Repeat measurements and report sensible precision rather than implying exactness.

This calculation does not determine focal length from an image file alone. A photograph’s apparent perspective and framing also depend on camera-to-subject distance, sensor dimensions, cropping, and lens design. Digital zoom or cropping changes displayed image size without changing the lens’s physical focal length.

Frequently Asked Questions

Can I calculate focal length from a photo alone?
Usually not. You need additional information, such as known object dimensions and distance, sensor size and field of view, or a calibrated camera model. Pixel dimensions by themselves are insufficient.

What measurements do I need for the thin-lens method?
Measure the real object’s size, its projected image’s corresponding size, and the object-to-lens distance. The calculator derives focal length and image distance from these.

Is focal length the same as image distance?
No. Focal length is a lens property, while image distance depends on where the object is. They are approximately equal only when the object is very far away, so incoming rays are nearly parallel.

Can I use inches instead of millimetres?
Yes. Use inches consistently for object size, image size, and object distance. The result will be in inches; multiply by 25.4 to convert inches to millimetres.

Why does my measured focal length differ from the lens label?
Possible causes include measurement error, thick-lens principal-plane offsets, a lens that is not an ideal thin lens, inaccurate focus, or using a different definition such as effective focal length. The simple equation is an estimate under its stated assumptions.

Related

Formula used
in o | Object size | mm | 100 | 0
in i | Image size | mm | 20 | 0
in u | Object distance | mm | 600 | 0
out f | Focal length | mm | u / (1 + o / i) | 2
out v | Image distance | mm | f * (o / i) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.