Lens Equation Calculator — 1/f = 1/do + 1/di
Calculate image distance, object distance, or focal length using the thin lens equation. Covers magnification, real vs virtual images, converging and diverging lenses.
Every optical instrument — cameras, microscopes, eyeglasses, telescopes — relies on the thin lens equation. It tells you exactly where an image forms given where an object is and what lens you're using. The math is simple, but interpreting the signs correctly trips people up. Virtual images, real images, inverted, upright — the thin lens formula handles them all through sign conventions.
The CalcHub lens equation calculator solves for focal length, image distance, or object distance, and also computes magnification.
The Thin Lens Equation
1/f = 1/d_o + 1/d_i- f = focal length (m or cm) — positive for converging lens, negative for diverging
- d_o = object distance from lens (positive)
- d_i = image distance (positive = real image on far side; negative = virtual image on same side as object)
|m| > 1 = magnified; |m| < 1 = reduced; negative m = inverted image
Image Types Quick Reference
| Object position | Image type | Real/Virtual | Upright/Inverted |
|---|---|---|---|
| Beyond 2f | Reduced | Real | Inverted |
| At 2f | Same size | Real | Inverted |
| Between f and 2f | Enlarged | Real | Inverted |
| At f | No image | — | — |
| Inside f | Enlarged | Virtual | Upright |
Worked Example
A camera lens has f = 50 mm. An object is 2 meters (2000 mm) away. Where does the image form?
1/d_i = 1/f − 1/d_o = 1/50 − 1/2000 = 0.02 − 0.0005 = 0.0195
d_i = 1/0.0195 ≈ 51.3 mm
The image forms just past the focal point — typical for photography where subjects are far from the lens.
Magnification: m = −51.3/2000 = −0.026 (tiny, inverted image on the film/sensor — exactly what cameras produce)
What's the difference between a real and virtual image?
A real image can be projected onto a screen — light rays physically converge at that point. A virtual image cannot be projected; the rays only appear to diverge from that point (like a mirror reflection). Real images from a converging lens occur when the object is beyond the focal point.
How do glasses correct vision?
Nearsighted (myopia): eyes converge light too strongly, focusing in front of the retina. Diverging lenses (negative f) spread rays before they enter the eye, pushing focus back onto the retina. Farsighted (hyperopia): eyes can't converge enough. Converging lenses (positive f) pre-converge rays to help.
What does the focal length tell me about a camera lens?
Focal length determines field of view and magnification. Wide-angle lenses have short focal lengths (18–35 mm on full frame), capturing more scene. Telephoto lenses have long focal lengths (200–600 mm), magnifying distant subjects. A 50 mm lens approximates human eye field of view.