Thin Lens Equation Calculator
Find where a lens forms an image, how large it is, and whether it is real or virtual, for converging and diverging lenses.
🔭 What is the Thin Lens Equation?
The thin lens equation tells you where a lens forms an image. It states that the reciprocal of the focal length equals the sum of the reciprocals of the object distance and the image distance: 1/f = 1/do + 1/di. Give it the focal length of a lens and the position of an object and it returns the position of the image. A second formula, m = −di/do, gives the magnification, so you also know how big the image is and whether it is the right way up. The approximation behind it is that the lens is thin enough for its thickness to be ignored compared with the distances involved.
Every instrument built around a lens depends on this relationship. A camera moves its lens until the image of the subject lands exactly on the sensor. A projector places the slide just outside the focal length so that a large, real image lands on a distant screen. A magnifying glass puts the object inside the focal length so that the eye sees an enlarged virtual image. Eyeglasses, microscopes and telescopes combine several lenses, and the output image of one is the input object of the next. The same equation covers diverging lenses, such as those used to correct short sight, once the focal length is given a negative sign.
The idea that most often trips people up is the sign convention. Textbooks differ, and this page uses the common real-is-positive convention: the object distance is positive for a real object, the image distance is positive when a real image forms behind the lens, and the focal length is positive for a converging lens. A negative image distance therefore means a virtual image, on the same side of the lens as the object, which cannot be shown on a screen. Also note that an object exactly at the focal point gives no finite image, because the light leaves the lens as a parallel beam.
The three modes match common problems. Find the image solves for di, m and the image height. Find f works backwards from distances measured on an optical bench. Find the object tells you where to put the object for a magnification you want, such as the projector or enlarger problem. Each shows a to-scale principal-ray diagram and a chart of image distance against object distance, so you can see the jump that happens as the object crosses the focal point. To get the focal length from a lens's glass and its curves, use the lens maker equation calculator, and for the bending of light itself the index of refraction calculator.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 — Object Beyond Twice the Focal Length
Converging lens, f = 10 cm, object 5 cm tall at do = 30 cm
Example 2 — A Magnifying Glass
Converging lens, f = 10 cm, a 2 cm object at do = 6 cm (inside the focal length)
Example 3 — A Diverging Lens
Diverging lens with |f| = 20 cm, a 6 cm object at do = 30 cm
Example 4 — Object at the Focal Point
Converging lens, f = 10 cm, object at do = 10 cm
Example 5 — Finding f on an Optical Bench
A sharp real image forms 24 cm from the lens when the object is 40 cm away
Example 6 — Placing the Slide in a Projector
Converging lens, f = 10 cm, wanted magnification m = −2
Example 7 — A Camera Lens
A 50 mm lens photographs a person 1700 mm tall standing 2000 mm away
❓ Frequently Asked Questions
🔗 Related Calculators
What is the thin lens equation?
The thin lens equation is 1/f = 1/do + 1/di, where f is the focal length, do the distance from the lens to the object and di the distance from the lens to the image. With f = 10 cm and do = 30 cm, 1/di = 1/10 - 1/30, so di = 15 cm.
How do you calculate the magnification of a lens?
Magnification is m = -di/do, which also equals image height divided by object height. A negative value means the image is inverted. For do = 30 cm and di = 15 cm, m = -0.5, an inverted image half the size of the object.
What sign convention does the thin lens equation use?
This calculator takes distances to a real object and a real image as positive, a converging lens as having positive f and a diverging lens as negative f. A negative image distance means a virtual image on the same side of the lens as the object.
When is the image from a converging lens real or virtual?
If the object is farther than the focal length, the image is real, inverted and formed on the opposite side. If the object is inside the focal length, the image is virtual, upright and larger. At exactly f no image forms.
What happens when the object is at the focal point?
The refracted rays leave the lens parallel, so the image distance is infinite and no image forms at any finite distance. This is the principle behind a collimated beam from a lamp placed at the focus of a lens.
Does a diverging lens ever form a real image?
Not from a real object. Its focal length is negative, so 1/di = 1/f - 1/do is always negative. The image is virtual, upright and reduced, lying between the lens and the focal point.
How do you find the focal length from object and image distances?
Add the reciprocals, f = 1 / (1/do + 1/di), with di negative for a virtual image. An object at 40 cm with a real image at 24 cm gives 1/f = 1/40 + 1/24, so f = 15 cm.
How far should the object be to get a given magnification?
Combine the two equations to get do = f (m - 1) / m. To get m = -2 with f = 10 cm, do = 10 x (-3) / (-2) = 15 cm, and the image forms at 30 cm.
How is a camera lens related to the lens equation?
A camera focuses by moving the lens until di matches the equation. A 50 mm lens on a subject 2 m away forms the image 51.28 mm behind the lens, with a magnification of -0.0256.
What is the difference between the thin lens equation and the lensmaker's equation?
The thin lens equation links object and image positions for a lens whose focal length is known. The lensmaker's equation gives that focal length from the glass and the curvature of the two faces.
Can the thin lens equation be used for thick lenses?
Only approximately. It assumes the lens is thin compared with the distances involved. For a thick lens, distances are measured from the principal planes rather than from the lens surface.