Thin Lens Calculator – Image Distance, Magnification and Dioptres
A lens does one thing: it changes where a bundle of rays appears to come from. This thin lens calculator turns that into numbers. Give it any two of the three distances in the thin lens equation and it returns the third, then derives the magnification, the image height, the optical power in dioptres, and — the part that trips people up — whether the image is real or virtual, upright or inverted, enlarged or reduced.
The equation and its rearrangements
With every distance measured from the centre of the lens, the Gaussian form is
1/f = 1/d_o + 1/d_i
which rearranges into the three closed forms the calculator actually evaluates: d_i = d_o·f / (d_o − f), d_o = d_i·f / (d_i − f) and f = d_o·d_i / (d_o + d_i). The magnification follows from the geometry of the undeviated central ray, m = −d_i/d_o = h_i/h_o. Put a 10 cm lens 15 cm from an object and you get d_i = +30 cm with m = −2: a real, inverted image twice the size, exactly what a slide projector does.
Signs are the whole game
Most wrong answers in optics are right arithmetic with a lost minus sign. This tool uses the Cartesian real-is-positiveconvention throughout and keeps the legend on screen: f > 0 converging, f < 0 diverging; d_o > 0 for a real object; d_i > 0 for a real image on the far side and d_i < 0 for a virtual image on the object's own side; m > 0 upright, m < 0inverted. Instead of leaving you to interpret the signs, the calculator writes the result out in words — “a real, inverted image forms 30 cm behind the lens”.
The five regions of a converging lens
Where the object sits relative to F and 2Fdecides everything, and the tool names the region for you. Beyond 2Fthe image is real, inverted and reduced — a camera or an eye. At exactly 2F the magnification is −1 and object and image are interchangeable. Between F and 2Fthe image is real, inverted and enlarged — a projector. At F the rays emerge parallel and no image forms at all. Inside F the image turns virtual, upright and enlarged: a magnifying glass. A diverging lens has none of this structure — every real object gives a virtual, upright, reduced image, wherever you put it.
d_o = f makes the denominator zero because the image genuinely is at infinity: the lens has become a collimator. The tool says so rather than returning Infinity. Nudge the object either side of F and watch the image sweep off to a huge positive distance one way, and to a huge virtual distance the other.Lens-maker's equation and optical power
Focal length can also come from the glass itself, through 1/f = (n/n_m − 1)(1/R₁ − 1/R₂), with 1/R = 0 for a flat surface. A crown-glass biconvex lens with n = 1.52 and radii of ±20 cm works out to f = 19.23 cm. Because only the ratio n/n_mmatters, immersing the same lens in water strips away most of its power — which is precisely why swimming goggles restore underwater vision by putting a layer of air back in front of the eye. Optical power is the reciprocal in metres, P = 1/f, so a +2.00 D reading lens is f = 50 cm and a 50 mm camera lens is +20 D.
The two-lens mode chains a second element by making the first image the object of the second, d_o2 = d − d_i1, and multiplies the magnifications. A negative d_o2 is a virtual object— light still converging when it reaches the second lens — which is normal in a microscope and needs no special handling. Every mode shows its full substitution, so you can check your own working line by line rather than just the final number.