About the Lens Calculator
Lenses bend light to form images. The lens in your eye focuses the world onto your retina; camera lenses focus it onto a sensor; spectacles, magnifying glasses, microscopes, telescopes and projectors all depend on the same simple rule. For a thin lens, the focal length, the distance of the object and the distance of the image are linked by the thin lens equation, and from them you can work out how big the image is and whether it is upright or upside down.
This lens calculator solves the thin lens equation for the image distance, the focal length or the object distance. It then gives the magnification, tells you whether the image is real or virtual, upright or inverted, enlarged or diminished, and gives the lens's power in dioptres, the unit used for glasses.
How to Use the Lens Calculator
Choose Find image distance, Find focal length or Find object distance.
Enter the two known values. Use a positive focal length for a converging (convex) lens and a negative one for a diverging (concave) lens.
Enter image distances as positive for a real image on the far side of the lens, negative for a virtual image on the same side as the object.
Choose millimetres, centimetres or metres; all distances must use the same unit.
The Formulas
thin lens equation 1/f = 1/dₒ + 1/dᵢ
image distance dᵢ = 1 ÷ (1/f − 1/dₒ)
magnification m = −dᵢ ÷ dₒ = image height ÷ object height
lens power P = 1 ÷ f (f in metres, P in dioptres)
Step-by-Step Examples
An object 30 cm from a 10 cm converging lens.
1/dᵢ = 1/10 − 1/30 = 2/30 = 1/15 → dᵢ = 15 cm
m = −15 ÷ 30 = −0.5
The image is real, inverted and half the size of the object.
A magnifying glass: an object 5 cm from the same lens gives dᵢ = 1 ÷ (1/10 − 1/5) = −10 cm and m = 2 — a virtual, upright image twice the size.
A diverging lens with f = −20 cm and an object at 30 cm gives dᵢ = −12 cm and m = 0.4.
Twice the focal length: an object 20 cm from a 10 cm lens forms an image 20 cm away, the same size and inverted.
Lens power: a lens with a 50 cm focal length has a power of 1 ÷ 0.5 = +2 dioptres.
Converging and Diverging Lenses
A converging lens, thicker in the middle, bends parallel rays inward so they meet at the focal point. Depending on where the object is, it can make a real image that can be projected onto a screen, or — when the object is closer than the focal length — a magnified virtual image, as in a magnifying glass. A diverging lens, thinner in the middle, spreads rays apart, so it always makes a smaller, upright, virtual image, like the view through a door peephole.
Where the Image Forms
For a converging lens, the position of the object decides everything:
object beyond 2f image between f and 2f, real, inverted, smaller
object at 2f image at 2f, real, inverted, same size
object between f and 2f image beyond 2f, real, inverted, larger
object at f no image — rays leave parallel
object inside f virtual, upright, larger (magnifying glass)
A camera uses the first case, a projector the third and a magnifying glass the last.
Sign Conventions
Different textbooks use different sign conventions for lenses. This calculator uses the real-is-positive convention common in schools: distances to real objects and real images are positive, distances to virtual images are negative, and converging lenses have positive focal lengths. A negative magnification means the image is inverted. If your course uses the Cartesian convention, where distances are measured along an axis, the signs of some quantities change, but the sizes of the answers are the same.
Lenses and Eyesight
Spectacle prescriptions are written in dioptres. A short-sighted person, whose eye focuses distant objects in front of the retina, needs a diverging lens with negative power, such as −2.00 D. A long-sighted person needs a converging lens with positive power. Reading glasses for people over about 45, whose eye lenses have become less flexible, are typically +1.00 to +3.00 D. Adding the powers of two thin lenses in contact gives the power of the combination.
Cameras, Projectors and Telescopes
In a camera, the subject is usually far away, beyond twice the focal length, so the lens forms a small, inverted real image on the sensor, just behind the focal point. Focusing moves the lens slightly to place that image exactly on the sensor as the subject distance changes. A projector works the other way round: a small slide or display sits just beyond the focal point, and the lens forms a large real image on a distant screen. A simple telescope uses two lenses — an objective that forms a real image of a distant object and an eyepiece that magnifies it — and its magnification is the ratio of their focal lengths.
Understanding Your Result
The headline is the image distance, object distance or focal length you asked for.
The image line describes the image: real or virtual, inverted or upright, enlarged or diminished, and where it forms.
The magnification line gives the magnification and relative image size.
The lens line gives the power in dioptres and the type of lens.
When Should You Use This Calculator?
Use it for physics homework on optics.
Use it to work out where a camera or projector image will form.
Use it to understand spectacle prescriptions in dioptres.
Common Mistakes
Using the wrong sign for a diverging lens. Its focal length is negative.
Mixing units. Use the same unit for every distance.
Placing the object at the focal point. No image forms there.
Treating thick lenses as thin. The equation assumes a thin lens.