PublicSoftTools
Tools6 min read

Lens & Mirror Calculator — Thin Lens Equation and Magnification

Cameras, telescopes, eyeglasses, and microscopes all use the same fundamental equation to form images: the thin lens formula 1/f = 1/dₒ + 1/dᵢ. The free lens and mirror calculator on PublicSoftTools solves this equation for any variable — and tells you whether the resulting image is real or virtual, enlarged or diminished, upright or inverted.

The Thin Lens Equation

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

Where f is the focal length, dₒ is the object distance from the lens/mirror, and dᵢ is the image distance. Magnification is m = −dᵢ/dₒ. The same equation applies to mirrors using the mirror equation with the same sign convention.

Image Types by Object Position

OpticObject positionImage type
Converging lensObject beyond 2fReal, inverted, diminished
Converging lensObject at 2fReal, inverted, same size
Converging lensObject between f and 2fReal, inverted, enlarged
Converging lensObject at fImage at infinity
Converging lensObject inside fVirtual, upright, enlarged
Diverging lensAny positionVirtual, upright, diminished
Concave mirrorObject beyond CReal, inverted, diminished
Convex mirrorAny positionVirtual, upright, diminished

How to Use the Calculator

  1. Open the lens and mirror calculator.
  2. Select the optic type: converging lens, diverging lens, concave mirror, or convex mirror.
  3. Choose which variable to solve for: focal length (f), object distance (dₒ), or image distance (dᵢ).
  4. Enter the two known values in centimeters.
  5. Read image distance, magnification, and image type (real/virtual, enlarged/diminished, inverted/upright).

Sign Conventions

The calculator uses the real-is-positive convention:

Practical Applications

Camera lens

A camera with a 50 mm lens (f = 5 cm) photographing a subject 2 m (200 cm) away: 1/dᵢ = 1/5 − 1/200 = 0.195, so dᵢ ≈ 5.128 cm. The sensor is placed at this distance behind the lens. Magnification = −5.128/200 = −0.0256 (small, inverted image, as expected for a camera).

Magnifying glass

A 10 cm focal length converging lens used as a magnifier, with the object 7 cm away: 1/dᵢ = 1/10 − 1/7 = −0.043, so dᵢ = −23.3 cm (negative = virtual image). Magnification = −(−23.3)/7 = +3.33. The image is virtual, upright, and 3.3 times larger — as expected for a magnifying glass.

Common Questions

What is the difference between a real and virtual image?

A real image forms where light rays actually converge after passing through the lens. You can project it onto a screen. A virtual image forms where rays appear to diverge from — it cannot be projected. Diverging lenses and convex mirrors always form virtual images.

How does focal length relate to diopters for eyeglasses?

Opticians use diopters (D), which is the reciprocal of focal length in meters: D = 1/f(m). A +2D lens has f = 0.5 m = 50 cm. Positive diopters correct farsightedness; negative diopters correct nearsightedness.

Calculate Lens and Mirror Properties

Solve for focal length, image distance, or object distance — with magnification and image type.

Open Lens & Mirror Calculator