Thin Lens Equation Calculator
A thin lens turns an object into an image whose position and size follow from a single relation, the thin lens equation: 1/f = 1/dₒ + 1/dᵢ. Enter any two of the three distances and read off the third, together with the magnification and the nature of the image — real or virtual, upright or inverted, enlarged or reduced.
Sign convention “real = positive”: a real object sits at dₒ > 0 in front of the lens; an image at dᵢ > 0 is real (on the far side), dᵢ < 0 virtual (on the same side). A focal length f > 0 describes a converging lens, f < 0 a diverging one.
Inputs
Result
- Image distance dᵢ 30.00 cm
| Lens type | Converging (f > 0) |
| Focal length f | 10.00 cm |
| Object distance dₒ | 15.00 cm |
| Image distance dᵢ | 30.00 cm |
| Magnification γ | -2.000 (×2.000) |
| Nature of the image | Real, inverted, enlarged |
| Optical power 1/f | 10.000 δ |
1/f = 1/dₒ + 1/dᵢ → dᵢ = f·dₒ / (dₒ − f) · γ = −dᵢ/dₒ
Making sense of the thin lens equation
Nobody at the bench starts from a definition of a thin lens. You have a lamp, a lens in a holder, a screen, and an image that is not where you thought it would be. The thin-lens model is the shortcut that gets you there: forget the thickness, collapse both faces into one plane through the optical centre, and treat every ray from an object point as meeting — or appearing to meet — at a single image point. That point is fixed by two lengths you can actually measure, the focal length f and the object distance dₒ.
1/f = 1/dₒ + 1/dᵢ
Short f means a hard bend. Long f is a gentle one, and the image sits further out.
Two of the three distances are enough. Give the calculator f and dₒ, it hands back dᵢ, the magnification, and whether the image is real. Give it dₒ and dᵢ, it works back to f. Look, it is the same equation either way — you are only choosing which letter to solve for. The reciprocal of f, with f in metres, is the optical power in dioptres: 10 cm of focal length is +10 D.
Reading the magnification and the nature of the image
Once dᵢ is known, the linear magnification is a one-liner. Size and orientation arrive together, which is why the minus sign is not decoration. |γ| is the height ratio: 2 means twice as tall, 1 means same size, anything under 1 is reduced. The sign is the orientation. Negative γ, upside down. Positive γ, the right way up.
γ = −dᵢ / dₒ
- γ < 0 — inverted. γ > 0 — upright. For a real object, a real image is inverted; the minus in the formula is doing that job.
- dᵢ > 0 — a real image, sitting in space. You can catch it on a screen or a sensor.
- dᵢ < 0 — a virtual image, on the object side. Only an eye (or another lens) “sees” it. A reading glass lives here.
Anyway, try f = 10 cm, dₒ = 30 cm. Then dᵢ = 15 cm, γ = −0.50: real, inverted, half-size. Slide the object in to 15 cm and the numbers swap — dᵢ = 30 cm, γ = −2 — still real and inverted, now twice as tall. That pair is conjugate: same lens, object and image exchanged. Look, dᵢ tells you whether a screen will work; γ tells you which way up the picture is. A virtual image stays upright, and there is nothing to project.
Three typical situations
Three set-ups eat most of the lab time. We run them from far object to object-against-the-glass.
A camera — the eye is the same machine with a retina instead of a chip — looks at something many focal lengths away through a converging lens. The image sits a whisker past the focal plane, real, inverted, reduced. You do not see it hanging in the air; it only exists on the sensor. Old SLR viewfinders showed the world upside down for that reason, and your visual cortex spends its life flipping the retinal picture. Focus is a millimetre or two of lens travel, not a rearrangement of the room.
A magnifying glass is the other end of the same lens. Object closer than f, and the formula returns a negative dᵢ — virtual, upright, enlarged; try f = 10, dₒ = 5 and you get dᵢ = −10, γ = +2.
A diverging lens (f < 0) never gives you a real image of a real object. The image is always virtual, upright and reduced, which is exactly what a short-sighted spectacle lens is for: it throws a virtual object to a place the myopic eye can still focus. There is no screen to hunt. You look through the glass. Anyway, slide the object in or out — γ stays between 0 and 1, dᵢ stays negative, and the image never crosses to the far side.
Object at the focal point: the image walks off to infinity
Put the object at dₒ = f and the denominator (dₒ − f) dies. Outgoing rays from that object point leave the lens parallel. They do not meet anywhere at a finite distance, and they do not appear to meet either. The image has gone to infinity, and the calculator will not divide by zero — it tells you so, rather than printing a rude infinity.
That is a collimator. Source in the focal plane, beam going straight down the bench.
A whisker closer than f and dᵢ flips negative (virtual). A whisker farther and dᵢ is a huge positive number, a real image a long way off. The other way round, a truly distant object (dₒ ≫ f) parks the image against the focal plane, which is why a camera set to “infinity” has the sensor sitting just behind F. Look, once the object is a few tens of focal lengths out, the gap between dᵢ and f is smaller than the holder. You will not see it on a school bench. Anyway, focus to infinity one way, infinity to the focus the other: the equation is symmetric.
Three rays that pin the image down
You do not need every ray in the bundle. Two already pin the image point; the third is a check.
- A ray into the lens parallel to the axis leaves through the far focal point (or, for a diverging lens, appears to come from the near one).
- A ray through the optical centre of a thin lens is undeviated — the two faces are locally parallel there.
- A ray through the near focal point leaves parallel to the axis.
Where any two of those meet, or where their backward extensions meet, is the image of that object point. Far-side meeting: real, dᵢ positive, put a screen there. Backward extensions: virtual, dᵢ negative, you hunt it with your eye. Look, on paper the dotted lines are tidy. On the bench you only see the real pencil of light; a virtual image is a looking-through job, not a catching-on-card job. For a diverging lens the first two rays still suffice: the parallel one fans out as if it came from the object-side focal point, and the central ray goes straight on.
The sketch at the top of this page is those three lines and nothing else.
Where a converging lens actually puts the image
For f > 0 the whole story is f and 2f. Four zones, four different images, and that is most of an A-level practical. Move the object from one zone to the next and the image changes nature, size and side. Anyway, remember the two landmarks: through 2f the image is real, same size, sitting at 2f on the far side; through f it runs away to infinity.
- dₒ > 2f — real, inverted, reduced, between f and 2f (a camera).
- dₒ = 2f — real, inverted, same size, at 2f on the far side (a 1:1 copier, or a 4f relay).
- f < dₒ < 2f — real, inverted, enlarged, beyond 2f (a projector).
- dₒ < f — virtual, upright, enlarged (a reading glass).
A projector is a magnifying glass run backwards. The slide sits between f and 2f, the screen is a long way off, the picture is huge and upside down — which is why the slide goes in inverted.
A diverging lens has none of that range. One family of images only: virtual, upright, reduced, wherever you put the object. You can glue the object to the glass or send it down the bench; γ stays below 1 and dᵢ stays negative. Look, there is no projector in a diverging lens on its own, and nothing to focus on a card. Short-sighted spectacles are not trying to throw a real image — they push a too-short focus back so the eye's own lens can finish the job on the retina.
Finding f from object and image
The second mode turns the equation around. You measure dₒ and dᵢ, you get f. That is the optical bench in one sentence: light an object, hunt a sharp image on a screen, read both distances from the lens plane. Measure from the glass, not from the foot of the rider — a couple of millimetres of holder shows up immediately in f. Once you have f, 1/f in inverse metres is the power in dioptres.
f = dₒ · dᵢ / (dₒ + dᵢ)
If 1/dₒ + 1/dᵢ = 0 the pair is afocal. Infinite focal length: a window, or two lenses that cancel.
Anyway, a virtual image (negative dᵢ) can still give a positive f — that is the magnifying glass again. You measure dₒ on the rail, you estimate dᵢ by sighting the virtual image (a pin and no parallax, if you are being careful), and f comes out positive. Get the sign of dᵢ wrong and f flips; you will swear you have a diverging lens. The calculator keeps the sign you type. It is your job to know whether that image was real.
Cartesian vs real-is-positive in A-level books
A-level sheets in the UK almost all use real-is-positive, often with the letters u, v, f. Real object, u positive; real image, v positive; converging lens, f positive. The equation is 1/f = 1/u + 1/v, which is what this calculator calls 1/f = 1/dₒ + 1/dᵢ. Undergrad books are less loyal. Many switch to a Cartesian rule: light left to right, distances in the direction of travel counted positive, so a real object to the left of the lens has a negative object distance.
Same physics. Different starting signs.
Cartesian: 1/v − 1/u = 1/f · real-is-positive: 1/f = 1/dₒ + 1/dᵢ
You cross from one to the other with dₒ = −u and dᵢ = v, for a real object and light going right. Magnification changes clothes as well. Cartesian writes γ = v/u, and the minus is already inside u. Here it is γ = −dᵢ/dₒ, minus in the formula. Look, feed this box an A-level u that someone has already made negative “because Cartesian” and the whole plot inverts. Anyway, pick one convention and finish the sum in it — including the magnification, including the sketch.
Newton's xx′ = f² measures from the focal points, not from the lens. A third origin, a third set of signs.
Phone camera versus projector
A phone camera is a converging lens a few millimetres across, object at “infinity”, sensor a hair past the focal plane. The picture on the chip is real, inverted, tiny. Software flips it before you see it, which is why nobody walks around with an upside-down camera roll. Zoom on a cheap module is often just a crop; a proper optical zoom slides lens groups so the effective f changes and the sensor stays put. Either way you are living in the dₒ ≫ f zone, hunting tenths of a millimetre of back-focus.
A projector lives in the opposite zone. Same kind of lens, opposite job.
The LCD panel or the slide sits between f and 2f. The screen is metres away, so dᵢ is large and |γ| is large, and the image is inverted — the panel is driven upside down, or the slide goes into the carrier flipped, so the wall comes out the right way up. Throw distance and image size are just this equation with the room as dᵢ. Look, you cannot turn a phone module into a projector by wishing: the object (the world) is on the wrong side of f. You also cannot turn a projector into a camera without putting the world a long way out and the chip near F. Anyway, two devices, one lens formula, two of the four zones — and a diverging element in a phone is only there to help the zoom, never to form the picture on its own.
The thin lens model wants a thickness you can ignore and rays close to the axis (the paraxial or Gaussian approximation). Open the aperture and aberrations show up — spherical, coma, chromatic. Distances here follow “real = positive”. A Cartesian convention, or a “light travels to the right” rule, will not plug into these boxes without a conversion.