Lens Equation Calculator (Thin Lens and Mirror)

Choose a convex or concave lens or mirror, enter the focal length and how far the object is, and read off where the image forms and how it looks.

Updated

Embed this calculator

Paste this code into your page. The calculator runs inside the frame and links back to the full version.

Keep the credit link in place. Do not resell the calculator.

Formula

  • Thin lens and mirror equation: 1/f = 1/do + 1/di, so di = f × do ÷ (do − f).
  • Magnification: m = −di ÷ do. Image height: hi = m × ho.

Sign convention (real is positive): f > 0 for convex lenses and concave mirrors, f < 0 for concave lenses and convex mirrors. di > 0 is a real, inverted image; di < 0 is a virtual, upright image. The magnitude of m tells you whether the image is enlarged (above 1) or reduced (below 1).

The lens and mirror formulas are the same; only where the image appears differs. A real image forms behind a lens and in front of a mirror.

Worked example

Convex lens, f = 10 cm, object 30 cm away and 5 cm tall.

di = 10 × 30 ÷ (30 − 10) = 15 cm (real), m = −15 ÷ 30 = −0.5, hi = −0.5 × 5 = −2.5 cm: a real, inverted, reduced image.

Move the object to 5 cm: di = 10 × 5 ÷ (5 − 10) = −10 cm, m = 2; the image is virtual, upright and twice as large.

Frequently asked questions

What is the thin lens equation?

1/f = 1/do + 1/di, where f is the focal length, do the object distance and di the image distance. Rearranged, di = f × do ÷ (do − f). For f = 10 cm and do = 30 cm, di = 10 × 30 ÷ 20 = 15 cm.

What sign convention does this calculator use?

Real is positive. Real objects have do > 0. A converging device (convex lens, concave mirror) has f > 0 and a diverging one (concave lens, convex mirror) has f < 0; you enter the size of f and the device type supplies the sign. A positive di means a real image (light really meets there: behind a lens, in front of a mirror) and a negative di means a virtual image (on the object's side of a lens, behind a mirror).

How is magnification found?

m = −di ÷ do. With di = 15 cm and do = 30 cm, m = −0.5: the image is half the size and inverted. The image height is m × the object height, so a 5 cm object gives −2.5 cm.

What happens when the object is inside the focal length?

A converging device then makes a virtual, upright, enlarged image, which is how a magnifying glass works. For f = 10 cm and do = 5 cm, di = −10 cm and m = 2.

Why is there an error when the object is exactly at the focal point?

The outgoing rays are parallel, so the image forms at infinity: do − f = 0 and the equation divides by zero. Move the object slightly.