Calculateus

Thin Lens Equation Calculator

Solve for focal length, image distance, or object distance using the thin lens equation, and find the resulting magnification.

Result

Focal Length
10 cm
Object Distance
30 cm
Image Distance
15 cm
Magnification
-0.5x (inverted)

Uses the standard sign convention: positive focal length for converging lenses, negative for diverging.

About the Thin Lens Equation Calculator

This calculator solves the thin lens equation for whichever of the three core quantities you don't already know, focal length, object distance, or image distance, and it also computes the resulting magnification. It's built for anyone working through optics problems involving cameras, magnifying glasses, telescopes, or simple lens setups, whether checking homework or planning where to place a lens and screen.

How It Works

You choose which quantity to solve for, then supply the other two distances in centimeters (plus focal length if it isn't the unknown). The calculator rearranges the thin lens equation to isolate the missing variable, then uses the object and image distances to compute magnification and reports whether the resulting image is upright or inverted. It follows the standard sign convention, with positive focal lengths for converging lenses and negative focal lengths for diverging ones.

1/f = 1/do + 1/di, where f is focal length, do is object distance, and di is image distance. Magnification m = -di / do; a negative m means the image is inverted, a positive m means it's upright.

Formula & Methodology

Working this by hand starts with rearranging 1/f = 1/do + 1/di algebraically for whichever variable is unknown, then taking the reciprocal of the result. Once all three distances are known, magnification follows directly from m = -di/do, and the sign of that result, not its size, tells you whether the image is inverted or upright.

Examples

Real inverted image from a converging lens

With a 10 cm focal length and an object placed 30 cm away, solving for image distance gives 1 / (1/10 - 1/30) = 15 cm, with a magnification of -15/30 = -0.5x, a smaller, inverted, real image.

Magnifying glass with a virtual image

With the same 10 cm focal length but the object moved closer than the focal length, to 5 cm, the image distance works out to -10 cm, and the magnification is -(-10)/5 = 2x, an enlarged, upright image, exactly how a magnifying glass behaves.

Advantages

  • Solves for any of the three core variables from the same equation, so you don't need to manually rearrange the algebra depending on which quantity is unknown.
  • Reports magnification and image orientation alongside the distance calculation, saving a second calculation step.
  • Flags physically invalid inputs, like an object distance equal to the focal length, instead of returning an infinite or undefined answer silently.

Common Mistakes

  • Forgetting the sign convention and treating a negative image distance as an error rather than the correct indicator of a virtual image.
  • Mixing units between focal length and object or image distance, such as entering focal length in millimeters while distances are in centimeters.
  • Misreading a negative magnification value as meaning the image is smaller, when the sign only indicates orientation and the magnitude separately indicates size.

Edge Cases to Watch For

  • If the object distance equals the focal length exactly, the equation would require dividing by zero, so the calculator returns an error instead of solving for image distance (and similarly for image distance equal to focal length when solving for object distance).
  • When solving for focal length, an object or image distance of zero also produces an error, since both terms in the equation must be defined and nonzero.
  • A negative computed image distance corresponds to a virtual image on the same side of the lens as the object, a valid and expected result for cases like a magnifying glass, not a sign of an error.

Common Use Cases

  • Photography and optics students solving for image or object distance in coursework or lab exercises.
  • Hobbyists designing simple optical setups, such as a projector, magnifier, or basic telescope, who need to know where an image will form.
  • Anyone checking whether a given lens and object placement will produce a real or virtual, magnified or reduced image.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

What is the thin lens equation?

1/f = 1/do + 1/di relates a lens's focal length to the distances of the object and the image it forms. Combined with the magnification formula m = -di/do, it predicts both where an image will form and whether it will be enlarged, reduced, upright, or inverted.

Conclusion

The thin lens equation is a compact relationship, but tracking signs correctly by hand is where most errors creep in. This calculator applies the standard sign convention consistently, so the distance, magnification, and orientation it returns are ready to interpret directly.