Thin Lens Equation Calculator

Enter an object distance, focal length, and object height to find the image distance (1/f = 1/do + 1/di), magnification, and image height, plus whether the image is real or virtual.

Quick Facts

Thin lens equation
1/f = 1/do + 1/di
Relates focal length to object and image distance, both measured from the lens center.
Magnification
m = −di/do = hi/ho
Negative m means an inverted image; |m| > 1 means the image is enlarged.
Sign convention
f > 0 converging, f < 0 diverging
do is positive for a real object; di is positive for a real image on the far side of the lens.

Your Results

Calculated
Image Distance (di)
-
di = (f × do) / (do − f)
Magnification (m)
-
m = −di / do
Image Height (hi)
-
hi = m × ho
Image Type
-
Real/virtual, upright/inverted, size

Ready

Enter the object distance, focal length, and (optionally) object height, then press Calculate.

Formula and Method for the Thin Lens Equation

The thin lens equation (also called the Gaussian lens formula) relates the distance of an object from a thin lens, the distance of the resulting image from the lens, and the lens's focal length: 1/f = 1/do + 1/di. It assumes the lens is thin compared to the object and image distances, and that light rays are paraxial — close to and nearly parallel with the optical axis. This calculator also derives magnification and image height from the same inputs.

How the calculation works

Enter the object distance (do) and focal length (f), then solve for image distance: di = (f × do) / (do − f). Magnification follows from m = −di / do, and if you supply an object height (ho), the image height is hi = m × ho. The sign of di tells you whether the image is real or virtual; the sign and magnitude of m tell you its orientation and size relative to the object.

Sign convention used here

This calculator uses the standard real-is-positive convention: do is positive for a real object placed in front of the lens. The focal length f is positive for a converging (convex) lens and negative for a diverging (concave) lens. A positive di means a real image forms on the opposite side of the lens from the object, where it could be projected onto a screen; a negative di means a virtual image forms on the same side as the object, as when looking through a magnifying glass. For magnification, a negative m means the image is inverted, a positive m means it is upright, |m| > 1 means the image is enlarged, and |m| < 1 means it is reduced.

Common mistakes and limits

  • Wrong focal-length sign: a diverging (concave) lens always has a negative focal length; entering it as positive will flip real/virtual results.
  • Object at the focal point: when do equals f, the denominator (do − f) is zero and rays exit the lens parallel — no finite image forms, which is how collimators and some laser setups are designed.
  • Thin-lens assumption: this formula ignores lens thickness and spherical aberration; thick lenses, wide apertures, or non-paraxial rays need the more general lensmaker's or matrix-optics treatment.
  • Mixed units: keep object distance, focal length, and object height in the same unit before entering them.

Frequently Asked Questions

What is the thin lens equation?
The thin lens equation, 1/f = 1/do + 1/di, relates a lens's focal length (f) to the distance of the object from the lens (do) and the distance of the resulting image from the lens (di). Solved for image distance, di = (f × do) / (do − f).
How do I know if the image is real or virtual?
With this calculator's sign convention, a positive image distance (di > 0) means a real image forms on the opposite side of the lens from the object, where it could be projected onto a screen. A negative image distance (di < 0) means a virtual image forms on the same side as the object, as when looking through a magnifying glass.
What does the sign of the focal length mean?
A positive focal length describes a converging (convex) lens, which bends parallel light rays inward to a real focus. A negative focal length describes a diverging (concave) lens, which spreads parallel rays outward from a virtual focus. Enter a negative value for f to model a diverging lens.
What does the magnification value tell me?
Magnification m = −di/do = hi/ho describes size and orientation together. A negative m means the image is inverted relative to the object; a positive m means it is upright. When |m| is greater than 1 the image is larger than the object; when |m| is less than 1 it is smaller.