Skip to content
K Knidox Search…
Physics · Optics

Lens Equation Calculator

Solve 1/f = 1/dₒ + 1/dᵢ for focal length or distances, with magnification.

cm
cm
Examples — tap to load
Image distance (dᵢ)
15cm

Magnification ≈ -0.5 (negative = inverted, real image)

The thin lens equation is 1/f = 1/dₒ + 1/dᵢ, and magnification is m = −dᵢ ÷ dₒ. For a converging lens with f = 10 cm and an object at 30 cm, the image forms at dᵢ = (10×30) ÷ (30−10) = 15 cm, with m = −0.5 — a real, inverted image at half size.

The thin lens equation

For a thin lens, 1/f = 1/dₒ + 1/dᵢ ties the focal length to the object distance (dₒ) and the image distance (dᵢ). Once you have those distances, the magnification m = −dᵢ/dₒ tells you how large the image is and whether it is upright or inverted.

1/f = 1/dₒ + 1/dᵢ  ·  m = −dᵢ ÷ dₒ

f = focal length, dₒ = object distance, dᵢ = image distance, m = magnification

Worked example

A converging lens has f = 10 cm and an object at dₒ = 30 cm. Find the image distance and magnification:

  1. 1
    Rearrange for the image distance. From 1/f = 1/dₒ + 1/dᵢ, isolate dᵢ = (f × dₒ) ÷ (dₒ − f).
  2. 2
    Substitute the values. dᵢ = (10 × 30) ÷ (30 − 10) = 300 ÷ 20 = 15 cm — a real image past the lens.
  3. 3
    Find the magnification. m = −dᵢ ÷ dₒ = −15 ÷ 30 = −0.5 — inverted and half the object’s size.

Sign conventions (real-is-positive)

The standard thin-lens convention used by this tool.

QuantityPositive (+)Negative (−)
Focal length fConverging (convex)Diverging (concave)
Image distance dᵢReal image (other side)Virtual image (same side)
Magnification mUpright imageInverted image
|m| value> 1 enlarged< 1 reduced

Sign conventions and common mistakes

Focal length sets the lens type. A positive f is a converging (convex) lens; a negative f is diverging (concave). Get this sign wrong and every downstream result flips.

Magnification carries two pieces of information. Its sign tells orientation — negative means inverted (and, for a single lens, real) — while its magnitude tells the size: |m| > 1 is enlarged, |m| < 1 is reduced.

Common mistake: forgetting that the equation works in reciprocals. After solving for 1/dᵢ you must take the reciprocal again to get dᵢ itself — a step that is easy to skip.

Converging or diverging?
Converging (convex) lenses have a positive focal length; diverging (concave) lenses have a negative one. The sign of f determines the lens type.
What does negative magnification mean?
The image is inverted relative to the object. A magnitude above 1 means it is enlarged; below 1 means it is reduced.
Does this work for mirrors?
Yes — the mirror equation 1/f = 1/dₒ + 1/dᵢ has the same form, so the math carries over with the appropriate mirror sign conventions.
What is a virtual image?
An image that forms on the same side as the object and cannot be projected onto a screen — like the magnified, upright image in a magnifying glass. It gives a negative image distance.
How do I get focal length from lens power?
Power in dioptres is the reciprocal of focal length in metres: P = 1/f. A +2 D lens has f = 0.5 m = 50 cm.
How do I solve 1/f = 1/dₒ + 1/dᵢ for the image distance?
Rearrange to dᵢ = (f × dₒ) ÷ (dₒ − f). For f = 10 cm and dₒ = 30 cm, dᵢ = (10 × 30) ÷ (30 − 10) = 15 cm. Remember the equation works in reciprocals, so invert 1/dᵢ to get dᵢ itself.