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
| Optic | Object position | Image type |
|---|---|---|
| Converging lens | Object beyond 2f | Real, inverted, diminished |
| Converging lens | Object at 2f | Real, inverted, same size |
| Converging lens | Object between f and 2f | Real, inverted, enlarged |
| Converging lens | Object at f | Image at infinity |
| Converging lens | Object inside f | Virtual, upright, enlarged |
| Diverging lens | Any position | Virtual, upright, diminished |
| Concave mirror | Object beyond C | Real, inverted, diminished |
| Convex mirror | Any position | Virtual, upright, diminished |
How to Use the Calculator
- Open the lens and mirror calculator.
- Select the optic type: converging lens, diverging lens, concave mirror, or convex mirror.
- Choose which variable to solve for: focal length (f), object distance (dₒ), or image distance (dᵢ).
- Enter the two known values in centimeters.
- Read image distance, magnification, and image type (real/virtual, enlarged/diminished, inverted/upright).
Sign Conventions
The calculator uses the real-is-positive convention:
- Object distance dₒ is positive when the object is on the incoming side (standard).
- Image distance dᵢ is positive for real images (can be projected) and negative for virtual images.
- Focal length f is positive for converging lenses and concave mirrors; negative for diverging lenses and convex mirrors.
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