Lens Focal Calculator

Lens focal length, mag, and diopters.

Physics and EnergyUpdated 2026-10-141 min read
Lens Focal Calculator
Focal length
...
Magnification...
Lens power...

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

  1. Enter object distance in cm.
  2. Enter image distance in cm.
  3. Read focal first.
  4. Read mag next (minus means inverted).
  5. Read diopters last.

Formula

1/f = 1/do + 1/di. Mag = -di/do. Diopters = 100/f with f in cm.
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.

  1. Sum: 1/30 + 1/60 = 0.05 per cm.
  2. Focal: 1 / 0.05 = 20 cm.
  3. Mag: -60 / 30 = -2 x.
  4. Power: 100 / 20 = 5 D.
  5. Tool shows 20 cm, -2 x, 5 D.

Reference table

Focal from pairs (cm)
ObjectImageFocal
202010
303015
306020
404020
6012040

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.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.