← All tools

Thin Lens Equation Calculator

Solve the thin-lens equation 1/f = 1/do + 1/di for the focal length, the object distance, or the image distance given the other two. Enter two of the three distances (each in mm, cm, m, or inches) and leave the one you want blank; the calculator also returns the lens power in dioptres, the magnification m = −di/do, and a classification of the image (real/inverted or virtual/upright, enlarged or reduced). Works for both converging (f > 0) and diverging (f < 0) lenses. Pairs with the Depth of Field and Exposure Value calculators for optics work. Everything runs locally in your browser.

Focal length f positive = converging, negative = diverging
Object distance do positive for a real object
Image distance di

Image details

Thin-lens equation 1/f = 1/do + 1/di, with the standard real-positive sign convention: the object is on the incoming side (do > 0); a real image forms on the opposite side (di > 0, inverted, m < 0) and a virtual image on the same side as the object (di < 0, upright, m > 0). Magnification m = −di/do; |m| > 1 is enlarged, |m| < 1 reduced. Lens power in dioptres is P = 1/f with f in metres (positive for converging, negative for diverging). Leave exactly one field blank to solve. Everything runs locally — nothing leaves your browser.