Hold a magnifying glass up to a sunny window and slide it back and forth until a tiny, sharp, upside-down picture of the window snaps into focus on the wall behind. Move the lens and the image moves, blurs, then sharpens again at a new distance. That little experiment is the thin lens equation made visible: the lens is enforcing a fixed mathematical relationship between where the object is and where its image must land.
The same relationship governs every camera lens, every pair of reading glasses, every projector and microscope. This article explains what the thin lens equation says, how the sign conventions encode real and virtual images, and how to work a complete example from object position to final magnification.
Why this calculation matters
Optical design begins with one question: given a lens and an object, where does the image form and how big is it? The thin lens equation answers both. Without it, focusing a camera, positioning a projector screen, or specifying a magnifier becomes guesswork.
The equation also explains everyday optical behaviour that otherwise seems arbitrary. It tells you why a camera must extend its lens slightly to focus on a close subject, why an object placed inside a magnifier's focal length produces an enlarged upright image while one placed outside produces an inverted shrunken one, and why a projector needs the slide just beyond the focal point. For students it is the gateway to geometrical optics; for working engineers it is the quick sanity check before any ray-tracing software is opened. It is approximate — it assumes a thin lens and small angles — but within that range it is fast, reliable, and remarkably accurate.
The core formula
A thin lens is one whose thickness is negligible compared with the distances involved, so light can be treated as bending at a single plane. Under that assumption, the lens links three quantities: the focal length f, the object distance d_o, and the image distance d_i. The thin lens equation states:
1/f = 1/d_o + 1/d_i
The focal length f is fixed by the lens itself — positive for a converging (convex) lens, negative for a diverging (concave) lens. The object distance d_o is measured from the lens to the object. The image distance d_i is what you usually solve for; its sign carries crucial information.
The sign convention is the part that trips people up, so it is worth stating plainly. A positive d_i means the image forms on the far side of the lens from the object — a real image, one you can project onto a screen. A negative d_i means the image forms on the same side as the object — a virtual image, one you can only see by looking through the lens.
The size of the image comes from the magnification:
m = -d_i / d_o
The magnitude of m gives the size ratio between image and object. The sign gives the orientation: a negative m means the image is inverted relative to the object, a positive m means it is upright. A magnification of -0.5, for instance, describes an image that is inverted and half the object's height.
A worked example
Take a thin converging lens with a focal length f = 10 cm. An object is placed d_o = 30 cm in front of it. Where does the image form, and what does it look like?
Step 1 — write the thin lens equation and isolate the unknown.
1/f = 1/d_o + 1/d_i
1/d_i = 1/f - 1/d_o
1/d_i = 1/10 - 1/30
Step 2 — combine the fractions over a common denominator.
1/d_i = 3/30 - 1/30 = 2/30
d_i = 30/2 = 15 cm
The image distance is 15 cm, and because it is positive, the image is real — it forms 15 cm behind the lens, on the opposite side from the object, and could be caught on a screen placed there.
Step 3 — compute the magnification.
m = -d_i / d_o
m = -15 / 30
m = -0.5
The magnification is -0.5. The negative sign tells you the image is inverted; the magnitude of 0.5 tells you it is half the height of the object. So a converging lens with the object well outside its focal length produces a real, inverted, reduced image — exactly the behaviour you see when sunlight forms that small upside-down picture of the window on the wall.
Common mistakes
Getting the sign convention backwards. The most frequent error is treating every image distance as positive. A negative d_i is not a mistake in your arithmetic — it is the equation telling you the image is virtual. Trust the sign and interpret it rather than discarding it.
Mixing up which distance is which. The object distance d_o and image distance d_i are easy to swap under time pressure. Object always means the thing you are looking at; image always means where its picture forms. Label them before substituting.
Forgetting that diverging lenses have negative focal length. A concave lens always has f less than zero. Plug a positive focal length into the equation for a diverging lens and every result that follows will be wrong.
Using inconsistent units. All three distances must share the same unit. Mixing centimetres and millimetres in the same equation is a classic slip; convert everything first.
Pushing the thin-lens model past its limits. The equation assumes a genuinely thin lens and paraxial rays — those close to the optical axis. For thick lenses, fast wide-aperture systems, or rays far from the axis, aberrations appear and a fuller model or ray tracing is needed. The thin lens equation is a first estimate, not the final word for demanding designs.
Try the interactive NovaSolver calculator
Solving one configuration by hand builds the method; dragging the object back and forth to watch the image flip from real to virtual builds the intuition. The Convex & Concave Lens Ray Tracing Simulator on NovaSolver lets you choose a converging or diverging lens and adjust the focal length, object distance, and object height, then traces the three principal rays in real time and reports the image distance, the magnification, the image height, and whether the image is real or virtual.
Related calculators
- Lensmaker Equation Simulator — Thin Lens Imaging — to work out the focal length itself from a lens's surface curvatures and refractive index.
- Lens Magnification & Ray Tracing Simulator — to focus on image size and orientation across a range of object positions.
- Thin Lens Ray Tracer & Optics Simulator — for a broader playground to trace rays through different lens setups.
You can browse the full set in the optics tools hub.
Closing note
The thin lens equation is geometrical optics distilled to a single reciprocal relation. Feed it a focal length and an object distance and it returns the image distance; pair that with the magnification formula and you also know the image's size and orientation. The sign conventions do the heavy lifting — they tell you, without any extra reasoning, whether the image is real or virtual, upright or inverted. Master those signs, keep your units consistent, and most everyday optics problems resolve into two short lines of arithmetic.
Top comments (0)