Intermediate

Focal Length Calculator — Thin Lens Equation

Solve for any unknown in the thin-lens equation — focal length, object distance, or image distance — and find the magnification, image type (real or virtual) and orientation. Works for any converging or diverging lens.

What to solve for

mm

Distance from the lens to the object (positive)

mm

Distance from the lens to the image (positive = real image)
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

The thin-lens equation 1/f = 1/dₒ + 1/dᵢ links focal length, object distance and image distance. Enter any two to solve for the third. Magnification m = −dᵢ/dₒ; negative m means inverted image. Works for converging (positive f) and diverging (negative f) lenses.

Formula
1/f = 1/dₒ + 1/dᵢ • m = −dᵢ / dₒ
How this is calculated

The thin-lens equation 1/f = 1/dₒ + 1/dᵢ relates the focal length f of a lens to the object distance dₒ (how far the object is from the lens) and the image distance dᵢ (where the focused image forms). All three quantities use the same unit (millimetres here). Enter any two and the calculator rearranges the equation to find the third.

Sign conventions: distances are positive when measured in the direction the light travels (real objects and real images are positive; virtual images are negative). A positive focal length means a converging lens; a negative focal length means a diverging lens. The magnification m = −dᵢ/dₒ gives the size ratio of image to object; a negative value means the image is inverted, which is normal for real images formed beyond the focal point.

This model assumes a thin, ideal lens with no aberrations, no thickness, and paraxial (small-angle) light rays. Real camera lenses are thick multi-element designs, so treating the focal length stamp on a lens as f in this formula gives a useful approximation for quick checks rather than precise optical design.

Frequently asked questions

For a camera lens focused at infinity (very distant objects), the image forms at the focal point so dᵢ ≈ f. The focal length printed on a lens (e.g. 50 mm) is the distance from the lens to the sensor when focused at infinity. The thin-lens formula becomes more relevant when focusing on close subjects.

A real image (dᵢ > 0) forms where light rays actually converge — you can project it on a screen. A virtual image (dᵢ < 0) forms where diverging rays appear to originate; it cannot be projected but can be seen through the lens (as with a magnifying glass when the object is inside the focal length).

Yes — use a negative focal length. A −50 mm diverging lens always produces virtual, upright, reduced images (dᵢ < 0, 0 < |m| < 1) regardless of object distance. The thin-lens formula handles this correctly.

Also known as

focal length calculator
thin lens equation solver
object image distance optics
lens formula calculator
camera lens focal length
magnification optics calculator
converging diverging lens

APA

TG we-Calculate Editorial Team. (2026). Focal Length Calculator — Thin Lens Equation [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/focal-length-calculator

Chicago

TG we-Calculate Editorial Team. "Focal Length Calculator — Thin Lens Equation." TG we-Calculate. 2026. https://we-calculate.com/calculator/focal-length-calculator.

IEEE

TG we-Calculate Editorial Team, "Focal Length Calculator — Thin Lens Equation," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/focal-length-calculator

BibTeX

@misc{wecalculate_focal_length_calculator, title = {Focal Length Calculator — Thin Lens Equation}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/focal-length-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?