Thin Lens Calculator

Focal Length (cm)10.0000
Object Distance (cm)15.0000
Image Distance (cm)30.0000
Magnification-2.0000
Image TypeReal

The Thin Lens Calculator solves the thin lens equation 1/f = 1/do + 1/di for whichever quantity you are missing. Provide any two of the focal length, object distance, and image distance, and the calculator returns the third along with the magnification and whether the image is real or virtual. It uses the standard sign convention, so a positive image distance is a real image on the far side of a converging lens, while a negative image distance signals a virtual image on the same side as the object.

Formula

1/f = 1/do + 1/di; m = -di/do

f
Focal length of the lens (positive for converging)
do
Object distance from the lens
di
Image distance from the lens (positive = real, negative = virtual)
m
Magnification (negative means inverted)

How it works

  1. Pick what you want to solve for — image distance, focal length, or object distance — and the matching input is hidden while you enter the two known values.
  2. The calculator rearranges 1/f = 1/do + 1/di to isolate the unknown: di = (f·do)/(do − f), f = (do·di)/(do + di), or do = (f·di)/(di − f).
  3. It then computes magnification m = −di/do and labels the image Real when di is positive or Virtual when di is negative, rounding every numeric result to four decimal places.

Worked example

A converging lens with a focal length of 10 cm has an object placed 15 cm away. Find the image distance and magnification.

  1. di = (f · do) / (do − f) = (10 × 15) / (15 − 10) = 150 / 5 = 30 cm.
  2. m = −di / do = −30 / 15 = −2.
  3. Because di is positive the image is real, and the negative magnification means it is inverted and twice the size of the object.

Image distance 30 cm, magnification −2, real and inverted image.

Frequently asked questions

What is the difference between a real and a virtual image?
A real image forms where light rays actually converge and can be projected onto a screen; in this sign convention it has a positive image distance. A virtual image forms where rays only appear to come from, cannot be projected, and shows up as a negative image distance — for example the upright, enlarged view through a magnifying glass.
Why is my magnification negative?
Magnification m = −di/do is negative when both object and image distances are positive, meaning the real image is inverted relative to the object. A positive magnification indicates an upright image, which typically accompanies a negative (virtual) image distance.
What sign convention does this calculator use?
It uses the standard convention where object distance is positive, focal length is positive for a converging lens and negative for a diverging lens, a positive image distance is a real image on the opposite side, and a negative image distance is a virtual image on the same side as the object.
What happens when the object sits at the focal point?
When the object distance equals the focal length the denominator do − f becomes zero, so the rays leave the lens parallel and the image forms at infinity. The calculator cannot return a finite value in that case and reports an error instead.