Thin Lens & Mirror Calculator

Find where a lens or curved mirror forms an image. Solve 1/f = 1/d_o + 1/d_i for the image distance, object distance or focal length, get the magnification and whether the image is real or virtual, and see the three principal rays drawn.

Calculator Science & Engineering Updated Oct 4, 2026
How to Use
  1. Pick what to find: the image distance, the object distance or the focal length.
  2. Choose the element: a converging or diverging lens, or a concave or convex mirror. The type sets the sign of the focal length, so enter f as a positive distance.
  3. Enter the distances in mm, cm, m, inches or feet. An image distance you type can be negative, meaning a virtual image.
  4. Add the object’s height if you want the image height too.
  5. Read the image distance, magnification and image type, and follow the three coloured principal rays in the diagram. Show Work lists every step with its signs.
Input
as a positive distance
negative = virtual
optional
Presets
Ray diagram
Image distance
—
Magnification
—
Image
—
Optical power
—

Worked Example

Sign convention: real is positive. f > 0 for converging lenses and concave mirrors, f < 0 for diverging lenses and convex mirrors; d_i > 0 for a real image, d_i < 0 for a virtual one.

A converging lens, f = 10 cm, object at 30 cm. 1/d_i = 1/f − 1/d_o = 1/10 − 1/30 = 2/30, so d_i = 15 cm. m = −15 ÷ 30 = −0.5: a real image on the far side of the lens, inverted and half the size. A 2 cm object makes a 1 cm image.

A magnifying glass: the same lens, object at 5 cm. 1/d_i = 1/10 − 1/5 = −1/10, so d_i = −10 cm. The minus sign means a virtual image on the same side as the object; m = −(−10) ÷ 5 = 2, upright and twice the size.

The common mistake: forgetting the minus sign on a diverging lens. For a 15 cm diverging lens and an object at 30 cm, f = −15 cm and 1/d_i = −1/15 − 1/30 = −1/10, so d_i = −10 cm with m = 1/3. Using f = +15 cm gives d_i = 30 cm and m = −1, a real inverted image that a diverging lens can never form.

Show Work

Enter the distances to see the step-by-step working.

Formulas

Thin lens and mirror equation
1/f = 1/do + 1/di
The same equation for lenses and mirrors, real-is-positive signs
Image distance
di = f do ÷ (do − f)
No image (at infinity) when do = f
Object distance
do = f di ÷ (di − f)
Where to put the object for a wanted image
Focal length
f = do di ÷ (do + di)
Negative result: diverging lens or convex mirror
Magnification
m = −di ÷ do = hi ÷ ho
Negative: inverted; |m| > 1: enlarged
Power and curvature
P = 1 ÷ f, R = 2f
P in dioptres with f in metres; R for a spherical mirror

From Reading Stones to Gauss

Ibn al-Haytham’s Book of Optics (written about 1011–1021) studied images in curved mirrors and glass, and convex lenses were in use as spectacles in northern Italy by the late 13th century: in a sermon of 1306, the friar Giordano da Pisa said the art of making them had been found less than twenty years earlier. Johannes Kepler’s Dioptrice (1611) gave the first proper theory of how lenses form real and virtual images, and explained the telescope.

Carl Friedrich Gauss’s Dioptrische Untersuchungen of 1841 set out the paraxial theory behind the simple 1/f = 1/do + 1/di, valid for rays close to the axis, which is why real lenses need several elements to keep edges sharp. The French ophthalmologist Ferdinand Monoyer proposed the dioptre as the unit of lens power in 1872, and spectacle prescriptions are still written in it.

About This Calculator

This calculator solves the thin lens and mirror equation for the image distance, the object distance or the focal length, for converging and diverging lenses and concave and convex mirrors. It uses the real-is-positive sign convention throughout and says where the image is in plain words (behind the lens, in front of the mirror), along with the magnification, image height, optical power or radius of curvature. The ray diagram draws the three principal rays (parallel, through the centre or vertex, and through the focal point) with dashed back-extensions for virtual images.

Everything runs in your browser; nothing you enter is sent anywhere.

Related tools: Snell’s Law & Refraction Calculator, Doppler Effect & Wave Calculator, and Unit Converter.

Frequently Asked Questions

Which sign convention does this calculator use?

Real-is-positive. f is positive for a converging lens or concave mirror and negative for a diverging lens or convex mirror. The object distance is positive for a real object. The image distance is positive for a real image (behind a lens, in front of a mirror) and negative for a virtual one. A 15 cm diverging lens therefore has f = −15 cm.

How do I tell whether an image is real or virtual?

From the sign of d_i. A real image (d_i > 0) can be caught on a screen; a virtual one (d_i < 0) can only be seen by looking through the lens or into the mirror. A converging lens with f = 10 cm makes a real image 15 cm away of an object at 30 cm, but a virtual image at −10 cm of an object at 5 cm.

What does the magnification tell me?

m = −d_i ÷ d_o gives the size ratio, and its sign gives the orientation: negative is inverted, positive upright. A 50 mm camera lens focused on a person 2 m away puts the image 51.28 mm behind the lens with m = −0.02564, so a 1.8 m person is 46.15 mm tall and upside down on the sensor.

What is a dioptre?

The unit of optical power, P = 1 ÷ f with f in metres. A lens with f = 10 cm is 10 D; +2.5 D reading glasses have a focal length of 1 ÷ 2.5 = 0.4 m. Diverging lenses for short sight have negative powers.

Why are objects in a convex mirror closer than they appear?

A convex mirror always makes a small, upright, virtual image. With f = −0.5 m, a car 10 m behind appears as an image 0.476 m behind the mirror at 0.0476 times its size. The brain reads the small image as a distant car.

How do I use the Thin Lens & Mirror Calculator?

Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Camera focusing

A 50 mm lens focused at infinity sits 50 mm from the sensor; to focus on a subject 2 m away it must move out to 51.28 mm, an extra 1.28 mm.

Magnifying glass

A 10 cm converging lens held 5 cm from a page gives an upright virtual image at −10 cm, magnified 2×.

Projector or enlarger

A slide 20 cm from the lens and a screen 60 cm behind it need f = 20 × 60 ÷ 80 = 15 cm, giving an inverted image 3× larger.

Make-up and shaving mirrors

A concave mirror with f = 20 cm and a face 10 cm away shows an upright image 2× larger, 20 cm behind the mirror.

Physics homework

A 15 cm diverging lens with an object at 30 cm gives d_i = −10 cm and m = 1/3: virtual, upright and smaller, as diverging lenses always are.

Last updated: