Lens Focal Calculator
Lens focal length, mag, and diopters.
What it does
Thin lenses focus by reciprocal sums: object and image distances combine into focal length, their ratio sets size and flip, and inverse meters give diopters. This page runs all three in cm.
The default is 30 cm out with 60 cm in. Reciprocals sum to 0.05 per cm for a 20 cm focus, mag is minus 2, and power is 5 diopters. Equal 20 and 20 cm pairs focus at 10 cm with minus one.
Signs carry meaning. Positive pairs here are real and inverted; virtual images take negative image distance and need signed entry. Diopters add for stacked thin lenses in contact.
Real glass adds error. Thickness, curvature, and color spread move focus off thin math, so use this for setup and confirm on the rail.
How to use
- Enter object distance in cm.
- Enter image distance in cm.
- Read focal first.
- Read mag next (minus means inverted).
- Read diopters last.
Formula
- do
- Lens to object distance.
- di
- Lens to image distance.
- f
- Focal length in the same units.
Thin lens equation with cm throughout; meters give the same focal in meters with diopters as 1/f. Negative mag means inverted. Virtual images and thick multi element stacks need signed and stacked passes.
Worked example
Example: 30 and 60 cm
Object 30 cm, image 60 cm.
- Sum: 1/30 + 1/60 = 0.05 per cm.
- Focal: 1 / 0.05 = 20 cm.
- Mag: -60 / 30 = -2 x.
- Power: 100 / 20 = 5 D.
- Tool shows 20 cm, -2 x, 5 D.
Reference table
| Object | Image | Focal |
|---|---|---|
| 20 | 20 | 10 |
| 30 | 30 | 15 |
| 30 | 60 | 20 |
| 40 | 40 | 20 |
| 60 | 120 | 40 |
Limits
- Thin lens only. No thick or multi element.
- Real pairs assumed. Virtual needs signs.
- Paraxial rays only. Edges differ.
- No aberrations.
Common mistakes
- Adding distances instead of reciprocals.
- Dropping the minus on mag.
- Mixing cm with meters for diopters.
- Reading power as focal length.
- Ignoring virtual signs.
Try it yourself
Quick checks. Answers sit tucked under each question.
20 cm object, 20 cm image?
10 cm, -1 x, 10 D.
10 cm object, 20 cm image?
6.7 cm (1/(1/10+1/20)=6.67), -2 x.
Questions
Focal length?
One over the sum of reciprocals. Here 20 cm.
Magnification?
Minus image over object. Here -2 x (inverted, doubled).
Power in diopters?
100 over focal cm. Here 5 D.
20 and 20 cm?
10 cm with -1 x and 10 D.
Real lenses exact?
No. Thick lenses and aberrations sit outside thin math.
Virtual images?
Signs flip for virtual images. This page assumes real pairs.