Lens Equation Calculator

Calculate focal length and image properties.

How it works

This calculator solves the thin lens equation for focal length, object distance or image distance, and gives the magnification. It works for converging (convex) and diverging (concave) lenses.

It uses the real-is-positive sign convention. A positive image distance means a real image on the far side of the lens; a negative one means a virtual image on the same side as the object. Diverging lenses have a negative focal length.

Worked example: an object 30 cm from a 10 cm lens

  1. A real, upside-down image half the size of the object forms 15 cm behind the lens. That's how a camera lens projects a small image onto its sensor.

Inside the focal length: a magnifier

Put the object closer than the focal length and the image distance turns negative. With a 10 cm lens and the object 5 cm away, dᵢ = −10 cm and m = +2: an upright, virtual image twice the size, which is how a magnifying glass works.

Diverging lenses

A diverging lens always gives a smaller, upright, virtual image. With f = −10 cm and the object 30 cm away, the image is at −7.5 cm and a quarter of the size. Lenses for short-sighted glasses are diverging.

At the focal point

With the object exactly at the focal length, 1/dᵢ = 0: the light leaves parallel and no image forms. The calculator reports this instead of returning a number.

Common questions

Does it matter what units I use?

No, as long as all three distances use the same unit. The magnification has no units.

What is lens power?

Power in dioptres is 1 ÷ f with f in metres. A 10 cm (0.1 m) converging lens has a power of +10 D; glasses prescriptions use the same unit.

Does it work for curved mirrors?

The same equation holds for mirrors, with a concave mirror taking a positive focal length. The mirror equation calculator handles that case.

Use it with