AJ Designer

Lens & Mirror Equation Calculator

Image distance equals focal length times object distance, divided by the quantity object distance minus focal length

f > 0 for a converging (convex) lens; f < 0 for a diverging (concave) lens.

Solution

Share:

Lens & Mirror Equation

The thin-lens equation and the mirror equation share the same algebraic form. Given the focal length and the object distance, the image distance follows directly; given any two of the three, the calculator solves for the missing one.

1/f = 1/dₒ + 1/dᵢ

Solve for Object Distance

Rearranging the lens/mirror equation for dₒ tells you where to place an object to land a sharp image at a specific spot — useful for screen-projection setups and photographic focusing distances.

dₒ = (f × dᵢ) / (dᵢ − f)

Solve for Focal Length

If you measure where the image forms for a known object distance, you can back out the focal length of the lens or mirror. This is the standard way to characterise an unknown lens on an optical bench.

f = (dₒ × dᵢ) / (dₒ + dᵢ)

Linear Magnification

The transverse magnification gives both the size ratio (|m|) and the orientation: m > 0 means the image is upright, m < 0 means inverted. |m| > 1 enlarges, |m| < 1 reduces.

m = −dᵢ / dₒ

How It Works

The lens and mirror equation 1/f = 1/dₒ + 1/dᵢ relates the focal length f of a thin lens or curved mirror to the distance from the optic to the object (dₒ) and to the image (dᵢ). The same formula applies to both surfaces because both deflect rays through a fixed focal point — only the sign convention differs. Enter any two of f, dₒ, dᵢ and the calculator returns the third, plus the linear magnification m = −dᵢ / dₒ. Negative focal lengths describe diverging optics; negative image distances describe virtual images on the same side of the optic as the object.

Example Problem

A converging lens has a focal length of 10 cm. An object is placed 30 cm in front of the lens. Find the image distance and the magnification.

  1. Identify the known quantities: focal length f = 10 cm (positive because the lens is converging) and object distance dₒ = 30 cm.
  2. Write the lens equation in a form that isolates dᵢ: dᵢ = (f × dₒ) / (dₒ − f).
  3. Substitute the known values: dᵢ = (10 × 30) / (30 − 10) = 300 / 20.
  4. Compute the image distance: dᵢ = 15 cm. Because dᵢ is positive, the image is real and forms on the opposite side of the lens from the object.
  5. Compute the magnification with m = −dᵢ / dₒ = −15 / 30 = −0.5.
  6. Interpret the result: |m| = 0.5 means the image is half the height of the object, and the negative sign means it is inverted. This is the classic setup that projects an object placed beyond 2f to a smaller, inverted image between f and 2f.

If the object had been placed inside the focal length (e.g., dₒ = 5 cm), the formula would return a negative dᵢ — a virtual image on the same side as the object, upright and magnified. That is the magnifying-glass regime.

When to Use Each Variable

  • Solve for Image Distancewhen you know the focal length and object distance, e.g., predicting where a real image will land on a screen or camera sensor.
  • Solve for Object Distancewhen you know the focal length and the required image position, e.g., placing a slide projector so the image falls exactly on the wall.
  • Solve for Focal Lengthwhen you have measured object and image distances on an optical bench and want to characterize an unknown lens or mirror.

Key Concepts

The thin-lens equation and the spherical-mirror equation have the same algebraic form, 1/f = 1/dₒ + 1/dᵢ — what changes between the two is only the physical interpretation of each sign. A positive focal length corresponds to a converging optic (convex lens or concave mirror); a negative focal length corresponds to a diverging optic (concave lens or convex mirror). A positive image distance means a real image (rays actually converge there); a negative image distance means a virtual image (rays only appear to come from there). The linear magnification m = −dᵢ / dₒ carries both the orientation (sign) and the relative size (magnitude).

Applications

  • Camera lenses: predicting where the sensor must sit relative to the lens for a chosen subject distance
  • Eyeglass prescriptions: a +2 diopter lens has a focal length of 0.5 m and corrects farsightedness
  • Telescope objectives: long focal lengths produce small, sharp real images at the focal plane
  • Slide and overhead projectors: solving for object distance to project a sharp image onto a wall
  • Magnifying glasses: placing an object inside the focal length produces an upright, enlarged virtual image
  • Photocopier and scanner optics: combinations of lenses set magnification close to 1× or to a chosen reduction
  • Concave shaving / makeup mirrors: dₒ < f gives an upright, enlarged virtual image of the face

Common Mistakes

  • Dropping a sign — focal length is negative for diverging optics; image distance is negative for virtual images
  • Treating the mirror equation as a separate formula — it is the same equation, only the physical interpretation of the signs differs
  • Forgetting the minus sign in m = −dᵢ / dₒ, which flips the predicted orientation of the image
  • Reporting |m| without the sign — magnification carries both size and orientation information
  • Confusing the mirror sign convention with the lens sign convention when teaching both in the same lesson (real images form on opposite sides of the two optics)
  • Dividing by zero at dₒ = f without recognising that this corresponds to parallel emerging rays (no finite image)

Frequently Asked Questions

What is the thin lens equation?

The thin lens equation is 1/f = 1/dₒ + 1/dᵢ, where f is the focal length of the lens, dₒ is the distance from the lens to the object, and dᵢ is the distance from the lens to the image. Solving for dᵢ gives dᵢ = (f × dₒ) / (dₒ − f). The same form describes a curved (spherical) mirror.

How do you calculate image distance with a lens?

Use dᵢ = (f × dₒ) / (dₒ − f). For a converging lens with f = 10 cm and an object at dₒ = 30 cm, the image distance is dᵢ = (10 × 30) / (30 − 10) = 15 cm. Because dᵢ is positive, the image is real and forms on the opposite side of the lens from the object.

What is the magnification formula?

The linear (transverse) magnification is m = −dᵢ / dₒ. The sign tells you orientation — positive m is upright, negative m is inverted — and |m| is the ratio of image height to object height. |m| > 1 is enlarged, |m| < 1 is reduced.

What is the difference between a real and a virtual image?

A real image is one where light rays actually converge — you can project it onto a screen. It corresponds to dᵢ > 0 in the lens/mirror equation. A virtual image is one where rays only appear to diverge from a point; you can see it through the lens but cannot project it. Virtual images correspond to dᵢ < 0, and the formula returns a negative image distance.

How do you use the lens equation for mirrors?

The mirror equation is 1/f = 1/dₒ + 1/dᵢ — the same as the thin-lens equation. The signs map differently: for a mirror, f > 0 means concave (converging) and f < 0 means convex (diverging), and dᵢ > 0 means the image forms on the same side as the object (real). Toggle this calculator to Mirror mode and the math is identical, only the labels and physical interpretation change.

What is the sign convention for the lens equation?

Using the Cartesian convention with light travelling left → right: focal length is positive for a converging lens or concave mirror and negative for a diverging lens or convex mirror; object distance is positive when the object sits on the incoming-light side; image distance is positive when the image forms on the outgoing-light side (real for a lens, same side as the object for a mirror) and negative when it forms on the opposite side (virtual).

What happens when the object is placed at the focal point?

When dₒ = f, the rays leaving the optic emerge parallel and never converge — there is no image at any finite distance. The lens equation gives 1/dᵢ = 0, so dᵢ is undefined. This is how a flashlight collimates light: place the bulb at the focal point of a curved reflector and the emerging beam is parallel.

When does a lens produce an upright, magnified image?

A converging lens produces an upright, magnified virtual image when the object is placed inside the focal length (dₒ < f). For example, with f = 10 cm and dₒ = 5 cm, dᵢ = (10 × 5) / (5 − 10) = −10 cm, and m = −(−10) / 5 = +2 — an upright image twice as tall as the object. This is how a simple magnifying glass works.

Reference: Hecht, Eugene. 2017. Optics. Pearson. 5th ed., chapters 5–6.

Lens & Mirror Equation

The thin-lens and spherical-mirror equation relates focal length, object distance, and image distance through a single reciprocal sum:

1/f = 1/dₒ + 1/dᵢ   •   m = −dᵢ / dₒ

Where:

  • f — focal length of the lens or mirror (positive for converging, negative for diverging)
  • dₒ — distance from the optic to the object (positive for a real object in front of the optic)
  • dᵢ — distance from the optic to the image (positive for a real image; negative for a virtual image)
  • m — linear magnification (positive = upright, negative = inverted; |m| is the size ratio)
Thin lens ray diagram with object distance, focal length, and image distanceFF'dodif

The same algebraic form describes a thin lens and a spherical mirror because both deflect light through a focal point — the difference is only in how each sign maps to a physical geometry.

Worked Examples

Photography

Where does the image form on a camera sensor for a 50 mm lens focused at 1 m?

A 50 mm (5 cm) lens is focused on a subject 100 cm away. How far behind the lens does the image plane sit?

  • f = 5 cm, dₒ = 100 cm.
  • dᵢ = (5 × 100) / (100 − 5) = 500 / 95.
  • dᵢ ≈ 5.26 cm.

The image plane sits about 5.26 cm behind the lens (just past one focal length).

This is why short-focal-length lenses keep the camera body compact — the image plane is never far behind the lens for distant subjects.

Optical Instruments

What focal length lens projects a 25 cm object to 100 cm with sharp focus?

A slide projector must form a real image of a 25 cm-distant slide at a 100 cm screen distance. What focal length is needed?

  • dₒ = 25 cm, dᵢ = 100 cm.
  • f = (25 × 100) / (25 + 100) = 2500 / 125.
  • f = 20 cm.

A 20 cm focal length converging lens lands the image exactly on the screen.

Magnification: m = −100 / 25 = −4, so the projected slide is four times the original size and inverted — which is why slides are loaded upside-down.

Magnifier

How magnified is the image when you hold a 10 cm magnifying glass 5 cm above the page?

A converging lens with f = 10 cm is held 5 cm above the page (so dₒ = 5 cm, inside the focal length).

  • f = 10 cm, dₒ = 5 cm (object inside f).
  • dᵢ = (10 × 5) / (5 − 10) = 50 / (−5) = −10 cm.
  • Image is virtual (dᵢ < 0). Magnification m = −(−10) / 5 = +2.

An upright virtual image, twice the size of the object — the classic magnifying-glass regime.

Move the lens farther from the page (past f) and the image flips to real and inverted — that is the projector regime above.

Related Calculators

Related Sites