Thin Lens Equation Calculator
Calculate image distance and magnification for a thin lens.
What is the Thin Lens Equation?
The thin lens equation connects three critical distances in any lens system: the focal length of the lens, the distance from the object to the lens, and the distance from the lens to the image. This relationship, expressed as 1/f = 1/do + 1/di, governs how cameras focus, how eyeglasses correct vision, and how microscopes magnify tiny specimens.
Picture a converging lens with a focal length of 10 centimeters. Place a candle 30 centimeters in front of it. The thin lens equation tells you exactly where the sharp image will form on the other side — in this case, at 15 centimeters from the lens. The image will be inverted and half the size of the original candle flame. This isn't approximation; it's geometric optics working with mathematical precision.
Understanding this equation transforms how you see optical devices. Every camera autofocus system, every projector adjustment, every telescope focusing knob operates on this principle. The magnification formula M = -di/do runs alongside it, telling you whether the image appears larger or smaller than the object and whether it's upright or inverted.
How it Works: Formulas Explained
The thin lens equation emerges from tracing light rays through a lens and applying Snell's law at each surface. For thin lenses — where thickness is negligible compared to focal length — the math simplifies beautifully to 1/f = 1/do + 1/di. Here f represents focal length, do is object distance, and di is image distance. All three distances measure from the optical center of the lens.
Sign conventions matter critically. For converging lenses, focal length is positive. For diverging lenses, it's negative. Object distance is positive when the object sits on the incoming light side (the usual case). Image distance is positive for real images that form on the opposite side from the object, negative for virtual images that appear on the same side as the object.
Magnification M = -di/do = hi/ho links the distances to actual image size. The negative sign indicates inversion: positive M means upright image, negative M means inverted. If |M| > 1, the image is enlarged; if |M| < 1, it's reduced. A magnification of -0.5 means the image is half the object's size and upside down.
Let's work through actual numbers. A lens with f = 8 cm, object at do = 24 cm. Plugging into 1/8 = 1/24 + 1/di gives 1/di = 1/8 - 1/24 = 3/24 - 1/24 = 2/24 = 1/12. Therefore di = 12 cm. The image forms 12 centimeters behind the lens. Magnification M = -12/24 = -0.5, confirming an inverted image at half size.
Step-by-Step Guide
- Identify your lens type and focal length. Converging lenses have positive focal lengths; diverging lenses have negative. A typical magnifying glass might have f = +15 cm. Reading glasses for farsightedness use converging lenses; for nearsightedness, diverging lenses with f = -40 cm or similar.
- Measure the object distance do. This is the distance from your object to the center of the lens. If you're projecting a slide onto a screen and the slide sits 12 cm from the lens, then do = 12 cm. Use consistent units throughout — centimeters work well for tabletop optics.
- Apply the thin lens equation to find image distance. Rearrange to di = 1 / (1/f - 1/do). With f = 15 cm and do = 20 cm: di = 1 / (1/15 - 1/20) = 1 / (4/60 - 3/60) = 1 / (1/60) = 60 cm. The image forms 60 centimeters behind the lens.
- Calculate magnification. M = -di/do. Using the values above: M = -60/20 = -3. The image is three times larger than the object and inverted. This explains why projectors need significant space between lens and screen to create large images.
- Check the sign of your results. Positive di means a real image you can project onto a screen. Negative di means a virtual image you see by looking through the lens, like a magnifying glass used at close range. Positive M means upright; negative means inverted.
- Verify with ray tracing if needed. Draw three rays from the top of your object: one parallel to the axis that bends through the focal point, one through the center that goes straight, and one through the near focal point that emerges parallel. Where they intersect is your image location.
Real-World Examples
Example 1: Camera focusing. A 50 mm camera lens (f = 5 cm) photographs a person standing 3 meters away. Converting to centimeters: do = 300 cm. Using 1/5 = 1/300 + 1/di gives 1/di = 1/5 - 1/300 = 60/300 - 1/300 = 59/300. So di = 300/59 ≈ 5.08 cm. The sensor must sit 5.08 cm behind the lens. For a distant landscape at do = 10 m = 1000 cm: 1/di = 1/5 - 1/1000 = 199/1000, giving di ≈ 5.025 cm. The lens moves only 0.06 cm between these shots — why autofocus motors are so precise.
Example 2: Magnifying glass. A jeweler uses a lens with f = 8 cm to examine a diamond. Holding the lens 6 cm from the stone (do = 6 cm, which is less than f): 1/di = 1/8 - 1/6 = 3/24 - 4/24 = -1/24. So di = -24 cm. The negative image distance means a virtual image 24 cm in front of the lens. Magnification M = -(-24)/6 = +4. The diamond appears four times larger and upright — perfect for inspection.
Example 3: Projector setup. An overhead projector has f = 25 cm. You want the image on a screen 4 meters (400 cm) away. Working backward: 1/25 = 1/do + 1/400 gives 1/do = 1/25 - 1/400 = 16/400 - 1/400 = 15/400. So do = 400/15 ≈ 26.7 cm. The transparency must sit 26.7 cm from the lens. Magnification M = -400/26.7 ≈ -15, producing a 15× enlarged inverted image.
Example 4: Eyeglass correction. A nearsighted person has a far point of 50 cm — beyond that, everything blurs. Their corrective lens must create a virtual image at 50 cm for objects at infinity. With do = ∞ and di = -50 cm: 1/f = 1/∞ + 1/(-50) = -1/50. So f = -50 cm = -0.5 m. Lens power in diopters is 1/f(meters) = -2.0 D, a typical mild myopia prescription.
Example 5: Microscope objective. A microscope objective lens has f = 4 mm. The specimen sits 4.2 mm away. Using 1/0.4 = 1/0.42 + 1/di (working in cm): 1/di = 1/0.4 - 1/0.42 = 2.5 - 2.38 = 0.12 cm⁻¹. So di ≈ 8.33 cm. Magnification M = -8.33/0.42 ≈ -19.8. The objective alone produces nearly 20× magnification with the intermediate image forming 8.33 cm behind it, ready for the eyepiece to magnify further.
Common Mistakes to Avoid
Unit inconsistency destroys accuracy. Mixing centimeters and meters in the same calculation produces nonsense. If focal length is 0.15 m and object distance is 30 cm, convert both to the same unit first: either 0.15 m and 0.30 m, or 15 cm and 30 cm. The equation doesn't care which unit you use, only that all three distances use identical units.
Ignoring sign conventions leads to wrong interpretations. A negative focal length means a diverging lens. A negative image distance means a virtual image on the same side as the object. Students often calculate di = -20 cm and think something's wrong, when actually they've correctly found a virtual image. The signs tell the physical story — read them carefully.
Forgetting that do must exceed f for real images. When do < f with a converging lens, you always get a virtual image. This isn't a mistake; it's how magnifying glasses work. But if you're trying to project an image onto a screen and getting negative di values, move the object farther from the lens until do > f.
Misplacing the lens in compound systems. In microscopes and telescopes, the image from the first lens becomes the object for the second. That intermediate image distance must be measured from the first lens, then the object distance for the second lens is measured from the second lens. The gap between lenses determines whether the final image is real or virtual.
Pro Tips
Use the lensmaker's equation for custom lenses. When you know the refractive index n and the radii of curvature R₁ and R₂, the focal length is 1/f = (n-1)(1/R₁ - 1/R₂). For a symmetric biconvex lens with n = 1.5 and R = 10 cm on both sides: 1/f = 0.5(1/10 - (-1/10)) = 0.5(2/10) = 0.1, so f = 10 cm. This helps when selecting or designing lenses for specific applications.
Estimate before calculating. If do is much larger than f (say do > 10f), then di ≈ f. Distant objects focus near the focal plane — why camera sensors sit approximately one focal length behind the lens. If do is just slightly larger than f, di becomes very large, explaining why macro photography requires extended lens-to-sensor distances.
Remember the 2f-2f rule. When do = 2f, then di = 2f and M = -1. The object and image are symmetric, both at twice the focal length, with the image exactly the same size as the object but inverted. This configuration minimizes total distance (do + di = 4f) for a 1:1 imaging system, useful in copy stands and document scanners.
Combine lenses by tracking image-to-object transitions. For two lenses separated by distance d, find the first image using lens 1, then treat that image as the object for lens 2. The object distance for lens 2 is d - di₁. If this value is negative, you have a virtual object — the light is converging toward a point beyond lens 2 before lens 2 intercepts it.
FAQs
A negative image distance means you have a virtual image — the light rays diverge after passing through the lens, but appear to originate from a point on the same side as the object. This happens when using a converging lens as a magnifier (object inside focal length) or with any diverging lens. You can't project a virtual image on a screen, but you can see it by looking through the lens.
Focal length is a fixed property of the lens — the distance from lens to focus point for parallel incoming light. Focus distance (object distance) is how far your subject is from the lens. A 50mm lens always has f = 50mm, but you focus it on objects at various distances by moving the lens relative to the sensor. The thin lens equation relates these two plus the image distance.
The thin lens equation works well when lens thickness is small compared to focal length and object/image distances. For thick lenses, you need to measure from the principal planes rather than the physical center. Camera lenses are compound systems with multiple elements — manufacturers specify effective focal length, and the thin lens equation still applies if you measure from the appropriate reference points.
Optometrists express lens strength in diopters: D = 1/f where f is in meters. A +2.0 D reading lens has f = 1/2 = 0.5 m = 50 cm. A -4.0 D myopia correction has f = -1/4 = -0.25 m = -25 cm. The thin lens equation works identically — just convert diopters to focal length first by taking the reciprocal in meters.
Related Calculators
- Snell's Law Calculator - Refraction at interfaces
- Coulomb Force Calculator - Electric force between charges
- Acceleration Calculator - Motion and kinematics
- Wave Speed Calculator - Wave propagation