Lenses and curved mirrors form images by bending or reflecting light so that rays from each point of an object meet again, or appear to. Where that image appears, how large it is and which way up it stands all follow from one compact equation that works for thin lenses and spherical mirrors alike. This calculator solves it for the image distance, the object distance or the focal length, classifies the image and draws a ray diagram with the three principal rays.
How to use the lens and mirror calculator
- Choose the optic: converging (convex) lens, diverging (concave) lens, concave mirror or convex mirror.
- Pick what to Solve for: image distance, object distance or focal length.
- Enter the Focal length as a positive size; its sign comes from the type you picked. Enter the Object distance from the object to the optic, and, when you know it, the Image distance, positive for a real image and negative for a virtual one.
- Optionally add the Object height to get the image height.
- Read the result, the magnification, the image description (real or virtual, upright or inverted, enlarged or reduced, and where it forms) and the optical power or radius of curvature. The diagram shows the parallel ray, the central ray and the focal ray.
Thin lens and mirror equations
Rearranged: di = fdo ÷ (do − f) and do = fdi ÷ (di − f). For a spherical mirror the focal length is half the radius of curvature, f = R/2. Lens strength is often quoted as optical power, P = 1/f, in diopters when f is in meters; eyeglass prescriptions use this unit.
Worked example
Projecting an image with a converging lens
A converging lens has f = 10 cm, and a 2 cm tall object stands 30 cm in front of it.
1/di = 1/10 − 1/30 = 0.06667 per cm, so di = 15 cm
m = −15 ÷ 30 = −0.5, so the image is real, inverted and half size: −1 cm tall, 15 cm behind the lens. A screen placed there would show it sharply.
The same lens as a magnifier. Move the object to 6 cm, inside the focal length. Now 1/di = 1/10 − 1/6 = −0.0667, so di = −15 cm: a virtual, upright image 2.5 times larger, on the same side as the object.
A camera lens. A 50 mm lens focused on a person 2 m away forms the image at 51.28 mm, which is why lenses move slightly outward to focus on near subjects. The magnification is −0.0256, so a 1.7 m person is about 44 mm tall on the sensor.
Image types at a glance
| Optic | Object position | Image |
|---|---|---|
| Converging lens or concave mirror | Beyond 2f | Real, inverted, reduced |
| At 2f | Real, inverted, same size | |
| Between f and 2f | Real, inverted, enlarged | |
| Inside f | Virtual, upright, enlarged | |
| Diverging lens or convex mirror | Anywhere | Virtual, upright, reduced |
Concave mirrors appear in makeup mirrors and telescopes; convex mirrors are used for car side mirrors and store security mirrors because they show a wide field of view, at the cost of making objects look smaller and farther away than they are.
Limits of the thin-lens model
The equation assumes a lens thin compared with the distances involved and rays close to the axis. Thick lenses, wide-angle rays and multi-element camera lenses need more detailed optics, and real glass bends colors slightly differently. For the refraction that makes lenses work, see the Snell’s law calculator, and to switch between millimeters, inches and meters, the length converter.
Frequently asked questions
What sign convention does the calculator use?
Real is positive. Object distances are positive for real objects. Image distances are positive for real images and negative for virtual ones. Converging lenses and concave mirrors have positive focal lengths; diverging lenses and convex mirrors have negative ones. You type the focal length as a positive size and pick the type.
How do I know if the image is real or virtual?
A positive image distance means a real image that can be projected onto a screen; a negative one means a virtual image you can see only by looking through the lens or into the mirror. Diverging lenses and convex mirrors always give virtual images of real objects.
What does a negative magnification mean?
The image is upside down. A magnification of −0.5 means inverted and half size; +2.5 means upright and two and a half times larger, as with a magnifying glass. The size of the number gives the scale, and the sign gives the orientation.
What happens when the object is exactly at the focal point?
The rays leave parallel, so no image forms at any finite distance; mathematically the image is at infinity. Searchlights and car headlights put their bulbs at the focal point of a mirror for exactly this reason.
Why does a magnifying glass need the object inside the focal length?
Only then does a converging lens form an upright, enlarged, virtual image. Move the object beyond the focal point and the image flips to real and inverted. With f = 10 cm and the object at 6 cm, the image is virtual, 15 cm away on the same side, and 2.5 times larger.