Thin Lens Equation Calculator

Calculate image distance, object distance, or focal length using the thin lens equation.

Positive = real object
Positive = converging; Negative = diverging
Please check your inputs and try again.

Interpreting the Thin Lens Equation and Its Signs

The thin lens equation connects where an object is placed, the focal length of the lens, and where the image forms. For the common real-is-positive convention used in many introductory problems, a converging lens has positive focal length and a diverging lens has negative focal length. A positive image distance corresponds to a real image on the opposite side of the lens; a negative image distance corresponds to a virtual image.

The equation is reciprocal, so object distance and image distance do not change linearly. Moving an object close to the focal point can send the image very far away. If a real object is placed inside the focal length of a converging lens, the calculated image distance becomes negative: the rays leave the lens diverging and the observer traces them backward to a virtual, upright, magnified image.

1/f = 1/do + 1/di    and    m=−di/do
SymbolMeaningWhy it appears / units
fFocal lengthPositive for converging, negative for diverging lenses in this convention.
doObject distanceDistance from object to lens; usually positive for a real object.
diImage distancePositive for real images, negative for virtual images.
mLateral magnificationNegative means inverted; positive means upright. |m| gives the size ratio.

Keep every distance in the same unit. Centimeters are convenient because the reciprocals preserve the equation as long as f, do, and di all use centimeters. The sign convention is more important than the chosen unit system.

Worked Examples

Example 1: Converging lens: do=30cm, f=10cm
1/di = 1/10 − 1/30 = 1/15
Result: di=15 cm, m=−0.5×, inverted, real
Classic camera/projector setup
Example 2: Diverging lens: do=30cm, f=−20cm
1/di = −1/20 − 1/30
Result: di = −12 cm, virtual image
Diverging lens always forms virtual image
Example 3: Object inside a converging lens focal length
f=10cm, do=6cm → 1/di=1/10−1/6
Result: di=−15cm, m=+2.5
The negative image distance means a virtual image; positive magnification means it is upright and 2.5 times the object's size.
Example 4: Object at twice the focal length
f=12cm, do=24cm → 1/di=1/12−1/24=1/24
Result: di=24cm, m=−1
At 2f, a converging lens forms a real image at 2f with the same size as the object but inverted.

Common Mistakes

⚠️
Ignoring the sign of focal length

A diverging lens requires negative f in this convention. Entering it as positive predicts the behavior of a converging lens instead.

⚠️
Calling every negative magnification a virtual image

The sign of magnification describes orientation. Image type is determined from di: positive is real and negative is virtual.

⚠️
Mixing centimeters and meters within one equation

The reciprocal terms must use the same distance unit. Mixing units destroys the numerical relationship even though each individual value looks reasonable.

Frequently Asked Questions

What is a real vs virtual image?
Real image: light rays actually converge (di>0). Can be projected on a screen. Virtual image: rays appear to diverge from a point (di<0). Cannot be projected, as in a mirror reflection.
When does magnification equal 1?
When do = 2f, the image forms at 2f on the other side with m = −1 (same size, inverted). This is used in relay lenses and copy machines.
What happens when the object is exactly at the focal point?
For a converging lens with do=f, the equation gives 1/di=0, so the ideal image distance tends toward infinity. The outgoing rays are parallel. In a real optical system, finite apertures and imperfect lenses limit how perfectly this condition can be achieved.
How can I tell whether an image is upright or inverted?
Use m=−di/do. A negative magnification means the image is inverted relative to the object, while a positive magnification means it is upright. The magnitude |m| tells how large the image is compared with the object, independent of orientation.
Can a converging lens make a virtual image?
Yes. If a real object is placed closer to a converging lens than the focal length, the outgoing rays diverge and appear to come from the object's side of the lens. The image distance is negative, the image is upright, and its magnification is greater than one.
Why is the thin lens equation only an approximation?
It treats the lens thickness as negligible compared with the object and image distances and assumes paraxial rays that stay close to the optical axis. Thick lenses, large-angle rays, and aberrations require more detailed optical models, but the thin-lens relation is highly useful for basic imaging problems.

Formula Explorer connections

Interpretation: This relationship connects light propagation, geometry, wavelength, refraction, interference or image formation. Assumption: Use a consistent sign convention and units. Paraxial rays, thin elements, coherent light, vacuum wavelength or ideal optical components may be assumed.

Lensmaker's Equation Calculator →Magnification Calculator →Malus Law Calculator →Physics Formula Explorer →