Article
Thin Lens Equation Calculator
Focal length in this guide comes from the thin-lens equation 1/f = 1/x + 1/y. At x = y = 0.5 m the result is f = 0.25 m and 4 diopters. The same path powers the thin lens equation calculator.
Linear magnification: p = y/x. Photon energy: E = h·f.
1/f = 1/x + 1/y
The calculator uses the numbers you enter: object distance x and image distance y in meters or centimeters, or focal length f. In the real-positive convention, 1/f = 1/x + 1/y, so f = xy/(x+y). At x = y = 0.5 m the result is f = 0.25 m and D = 4. With f = 0.1 m and x = 0.3 m the image distance is y = 0.15 m. Glasses at +2 D match f = 0.5 m. With an object at 2 m and an image near 52 mm you get f ≈ 50.7 mm. The model does not fit contact lenses and does not solve a virtual image in the form fields.
1/f = 1/x + 1/y
example: x = y = 0.5 m → f = 0.25 m (4 D)
also: f = 0.1 m, x = 0.3 m → y = 0.15 m
diopters: D = 1/f (f in meters)
| x | y | f | D |
|---|---|---|---|
| 0.5 m | 0.5 m | 0.25 m | 4 D |
| 0.3 m | 0.15 m | 0.1 m | 10 D |
| — | — | 0.5 m | 2 D |
| 2 m | ≈52 mm | ≈50.7 mm | ≈19.7 D |
Thin-lens equation. Not a contact-lens fitter.
Quick comparison
| Scenario | Input | Result |
|---|---|---|
| School x = y | 0.5 m and 0.5 m | f = 0.25 m (4 D) |
| Image at known f | f = 0.1 m, x = 0.3 m | y = 0.15 m |
| Glasses +2 D | D = 2 | f = 0.5 m |
| Marked “50 mm” | x = 2 m, y ≈ 52 mm | f ≈ 50.7 mm |
Four worked examples
You can repeat each scenario in the thin lens equation calculator.
1. x = y = 0.5 m gives 0.25 m
Focal-length mode, distances in meters.
- Choose focal-length mode f.
- Enter x = 0.5 and y = 0.5.
- The quotient xy/(x+y) = 0.25/1 = 0.25.
- The result is f = 0.25 m (4 D).
2. f = 0.1 m and x = 0.3 m give y = 0.15 m
Image-distance mode.
- Choose image-distance mode y.
- Enter f = 0.1 and x = 0.3.
- The quotient f·x/(x−f) = 0.03/0.2 = 0.15.
- The result is y = 0.15 m.
3. Glasses at +2 D give f = 0.5 m
Diopters use f in meters: D = 1/f.
- With D = 2 invert the formula: f = 1/D.
- Compute 1/2 = 0.5.
- That length is the same as 50 cm.
- The result is f = 0.5 m.
4. Object at 2 m and image ≈52 mm give ≈50.7 mm
A check against a marked “50 mm” lens.
- Enter x = 2 and y = 0.052 (meters).
- Compute f = xy/(x+y) = 0.104/2.052.
- The result is ≈ 0.0507 m, about 50.7 mm.
- The result is f ≈ 50.7 mm.
Common mistakes with 1/f = 1/x + 1/y
- Mixing m and cm — every distance must share one unit.
- Taking the arithmetic mean of x and y — f is the harmonic mean, not (x+y)/2.
- Computing diopters from f in cm — D = 1/f needs f in meters.
- Looking for a contact-lens fit — that is not this page.
- Expecting a virtual image in the fields — here x, y and f are positive.
- Setting x = f — then the denominator x−f in mode y is zero.
Frequently asked questions
How is f calculated on this page?
With positive x and y: f = xy/(x+y), or 1/f = 1/x + 1/y. At x = y = 0.5 m the result is f = 0.25 m and 4 diopters.
How do I find image distance y?
Choose mode y. Enter f and x. The result is y = f·x/(x−f). With f = 0.1 m and x = 0.3 m you get y = 0.15 m.
What is the focal length of a 4 D lens?
With D = 4 and f in meters: f = 1/D = 0.25 m. That matches x = y = 0.5 m in focal-length mode.
How does this page differ from magnification p = y/x?
Here you solve the lens equation for f, x, or y. The magnification page uses the ratio p = y/x.
Does it handle a virtual image or a diverging lens?
Not in the form fields. Here x, y and f are positive: a real object, a real image and a converging lens.
Which units should I use: m or cm?
School problems often use cm; SI stays in meters. All distance fields must share one unit. Diopters always use f in meters.