Lens Equation Calculator

Calculate focal length, object distance, and image distance

The lens equation calculator solves the thin lens formula 1/f = 1/do + 1/di for focal length, object distance, or image distance. Calculate magnification and determine real vs. virtual image formation. Supports cm and inches.

Lens Equation Calculator

1/f = 1/do + 1/di
m = -di/do (magnification)

How to Use the Lens Equation Calculator

The thin lens equation 1/f = 1/do + 1/di relates focal length to object and image distances. Choose what to solve for and enter the other two values.

Sign Convention

Converging (convex) lens: f > 0. Diverging (concave) lens: f < 0. Real object: do > 0. Real image (opposite side from object): di > 0. Virtual image (same side as object): di < 0.

Magnification

m = −di/do. |m| > 1 means enlarged. |m| < 1 means reduced. m < 0 means inverted (real image). m > 0 means upright (virtual image).

Example

Converging lens (f = 10 cm), object at do = 30 cm: 1/di = 1/10 − 1/30 = 3/30 − 1/30 = 2/30, so di = 15 cm. m = −15/30 = −0.5 (real, inverted, reduced image).

Frequently Asked Questions

What is the thin lens equation?

The thin lens equation is 1/f = 1/do + 1/di, where f is focal length, do is object distance, and di is image distance (all in the same units). Magnification m = -di/do. Negative magnification means the image is inverted. Positive di means a real image forms on the opposite side from the object.

What is the sign convention for lenses?

Using the real-is-positive convention: distances measured in the direction of incoming light are positive. For a converging (convex) lens, focal length f > 0. Object distance do > 0 for real objects. Image distance di > 0 for real images (on the far side), di < 0 for virtual images (on the same side as the object).

Is this calculator free?

Yes, completely free with no signup required. All calculations run in your browser.

Is my data private?

Yes. All calculations run locally. Nothing is transmitted.

What does diopter mean for eyeglass prescriptions?

A diopter is 1/focal length in meters. A +2 diopter lens has a focal length of 0.5 m (50 cm) — it's converging (used for farsightedness). A -2 diopter lens has a focal length of -0.5 m — it's diverging (used for nearsightedness). Stronger prescriptions have larger diopter numbers.