Physics · Optics

Thin lens calculator

Solve the thin-lens equation for a real object and see the image distance and magnification. Distances are measured from the lens: f > 0 for convergence, d_i > 0 for a real image and d_i < 0 for a virtual image.

Created v1.0

By Thibaut Grzelak, Mechanical Analysis Engineer

Optics
01Calculation inputs1/f = 1/d_o + 1/d_i ; m = −d_i/d_o
fd_od_i
Object on the left; real image on the right, virtual image on the left (dashed). Arrow direction shows inversion. Diagram scale adapts to the distances.
Positive for a converging lens, negative for a diverging lens; f ≠ 0.
Real object only: positive distance from the lens, d_o > 0.
Positive for a real image; negative for a virtual image on the object side.
02

Results

Object distance d_o
—

Real object only: positive distance from the lens, d_o > 0.

Image distance d_i
—

Positive for a real image; negative for a virtual image on the object side.

Magnification
—

m < 0: inverted; m > 0: upright. |m| is the image/object size ratio.

Relation and numerical substitution1/f = 1/d_o + 1/d_i ; m = −d_i/d_o

—

Thin lens in the same surrounding medium on both sides, paraxial rays and real object (d_o > 0). Lens thickness is neglected.

01Formulas and symbols

Formulas used

d_id_i = 1 / (1 / f − 1 / d_o)Image distance from focal length and object distance.
ff = 1 / (1 / d_o + 1 / d_i)Focal length from conjugate distances.
d_od_o = 1 / (1 / f − 1 / d_i)Object distance from focal length and image distance.
mm = −d_i / d_oSigned transverse image magnification.
02Assumptions and limits

Scope of validity

  • Thin lens in the same surrounding medium on both sides, paraxial rays and real object (d_o > 0). Lens thickness is neglected.
03Validation example

Reference numerical case

  1. Given f = 0.10 m and d_o = 0.30 m: d_i = 1/(10 − 3.333…) = 0.15 m, then m = −0.15/0.30 = −0.5.
  2. For f = 0.10 m and d_o = 0.05 m: d_i = −0.10 m and m = +2, a virtual upright image.
04References

Technical references

  1. University Physics Volume 3, §2.4 Thin Lenses — OpenStax

FAQ

What happens when the object is at the focus?

For d_o = f, emerging rays are parallel and the image is at infinity. The calculator reports this singularity instead of displaying a finite distance.

Can an image distance be negative?

Yes: the image is virtual and appears on the same side as the real object. It cannot be projected directly onto a screen.

Does negative magnification mean a smaller image?

The sign indicates inversion. Size depends on |m|: below one means smaller, above one means larger.

05Equation and sign convention

The reciprocals of the object and image distances add to the reciprocal focal length. A converging lens with the object beyond its focus gives a real inverted image; moving the object inside the focus produces a virtual upright image.

06Model limits

This is not a precision optical design tool. Thick lenses, virtual objects, aberrations, diffraction and multi-lens systems are excluded. The schematic adapts its scale; it is not a calibrated ray trace.

07Common mistakes

Do not mix unsigned distances with this signed convention. Near d_o = f, a small change in input causes a large change in image distance; two-digit output does not remove this physical sensitivity.