Optics: Lens / Mirror Equation Calculator

Enter focal length f, object distance d₀, and object height h₀ to compute image distance dᵢ, magnification m, and the image nature (real/virtual, upright/inverted). Non-threatening & private—everything runs in your browser.

Inputs

Equation: 1/f = 1/d₀ + 1/dᵢ, magnification m = −dᵢ/d₀ = hᵢ/h₀. Default sign rules: f > 0 for converging (convex lens, concave mirror); f < 0 for diverging (concave lens, convex mirror).

Results

Image distance dᵢ:
Signs tell side: + usually opposite lens’ object side (real), − same side (virtual).
Magnification m & image height hᵢ:
m = −dᵢ/d₀; hᵢ = m·h₀.
Image nature:
“Real” if rays actually converge; “Virtual” if they seem to from extensions.
Axis Element Focal points Object Image Rays

How to Use This Lens / Mirror Calculator

Pick an optical element and enter f (focal length), d₀ (object distance), and h₀ (object height) in your preferred units. The calculator applies the thin lens / spherical mirror relation 1/f = 1/d₀ + 1/dᵢ to solve for the image distance dᵢ, then computes the magnification m = −dᵢ/d₀ and image height hᵢ = m·h₀. The signs tell you if the image is real or virtual and upright or inverted.

Sign Conventions at a Glance

  • Converging elements: convex lens or concave mirror → f > 0.
  • Diverging elements: concave lens or convex mirror → f < 0.
  • Object distance d₀: positive for a real object in front of the element.
  • Image distance dᵢ: lenses—dᵢ > 0 is real on the far side; mirrors—dᵢ > 0 is real in front of the mirror.
  • Magnification: m < 0 inverted image; m > 0 upright image.

Common Scenarios

  • Object at infinity (very large d₀): light is nearly parallel and the image forms at dᵢ ≈ f.
  • Object at the focal point (d₀ = f): image is at infinity (collimated output) — useful for projectors and searchlights.
  • Object inside the focal length of a converging lens (d₀ < f): image is virtual, upright, and magnified — a simple magnifier.
  • Diverging lens: image is always virtual, upright, and reduced (useful for eyeglasses and peepholes).
  • Concave mirror: behaves like a converging element; f > 0. For a spherical mirror, f = R/2, where R is the radius of curvature.
  • Convex mirror: always forms a virtual, upright, reduced image behind the mirror — wide field of view.

Practical Tips

  • Measure distances along the optical axis from the lens plane or mirror vertex. Keep units consistent (m, cm, or mm).
  • If your goal is a particular image size, adjust d₀ to target m = hᵢ/h₀; the calculator shows m live.
  • To “focus to a screen,” look for dᵢ > 0 (real image) and position the screen at that distance on the image side.
  • For mirrors, remember that the real image forms in front of the mirror (same side as the object), while a virtual image appears behind the mirror.

Assumptions & Limitations

This tool uses the thin lens and spherical mirror models in the paraxial (small-angle) regime. It ignores thickness, aberrations, and aperture effects. Real optics may deviate, especially with large apertures or wide fields.

Educational use only — not for safety-critical design. For precise optical systems, consult detailed lens data and tolerances.

5 Fun Facts about Lenses & Mirrors

Your brain flips reality

The retina’s image from your eye’s convex lens is upside down and left/right swapped—your visual cortex quietly rotates it back, so you never notice the raw inverted projection.

Human optics

Objects in mirror…

That car-door warning exists because a convex mirror’s negative focal length always yields m < 1: everything is shrunk to squeeze in more field of view, so distances feel longer than they are.

Road safety

Solar furnaces are giant makeup mirrors

Massive concave mirrors in places like Odeillo, France focus sunlight to spots hotter than 3,000 °C—just the lens/mirror equation scaled up to a 54-meter focal length.

Sun power

Hubble needed glasses

A tiny polishing error on Hubble’s main mirror shifted focus by about 2 microns. NASA fixed it by adding corrective optics (like contact lenses in space) that reintroduced the missing curvature.

Space repair

Focus rings barely move

Going from “infinity” to 0.5 m on a 50 mm lens means changing dᵢ by only a few millimeters. Those tiny helicoid twists are solving the same 1/f = 1/d₀ + 1/dᵢ you are.

Camera geekery

Explore more tools