Lens and Mirror Calculator — Calculate Image Distance, Magnification, and Focal Length
The thin lens equation and mirror formula describe how lenses and mirrors form images. These equations are used in optics courses, in designing cameras, microscopes, telescopes, and corrective lenses. The free lens and mirror calculator on PublicSoftTools solves for image distance, magnification, and focal length — covering converging and diverging lenses and concave and convex mirrors.
The Thin Lens Equation and Mirror Formula
Both lenses and mirrors follow the same mathematical form:
1/f = 1/u + 1/v
Where f is the focal length, u is the object distance from the lens/mirror, and v is the image distance from the lens/mirror. This can be rearranged to find any variable:
- Image distance: 1/v = 1/f − 1/u → v = uf / (u − f)
- Object distance: 1/u = 1/f − 1/v
- Focal length: 1/f = 1/u + 1/v → f = uv / (u + v)
Magnification: m = −v/u
The negative sign in the magnification formula means a real image (positive v) is inverted (negative m). A virtual image (negative v) is upright (positive m). Magnification |m| > 1 means the image is larger than the object; |m| < 1 means smaller.
Sign Convention
| Quantity | Positive | Negative |
|---|---|---|
| Object distance (u) | Object on the same side as incoming light (real object) | Object on opposite side (virtual object — rare in problems) |
| Image distance (v) | Image on the opposite side from incoming light (real image) | Image on the same side as incoming light (virtual image) |
| Focal length (f) | Converging lens or concave mirror (converges light) | Diverging lens or convex mirror (diverges light) |
| Magnification (m) | Upright image (same orientation as object) | Inverted image (flipped relative to object) |
How to Use the Lens and Mirror Calculator
- Open the lens and mirror calculator.
- Select the optical element type: converging lens, diverging lens, concave mirror, or convex mirror.
- Enter the known values — enter any two of object distance (u), image distance (v), and focal length (f), and the calculator finds the third.
- Click Calculate. The tool returns the missing variable, the magnification, and describes the image (real/virtual, upright/inverted, enlarged/diminished).
Image Formation Summary
| Lens/mirror type | Object position | Image type | Applications |
|---|---|---|---|
| Converging lens (f > 0) | u > 2f | Real, inverted, diminished | Camera, human eye imaging distant objects |
| Converging lens (f > 0) | u = 2f | Real, inverted, same size (m = −1) | Photocopier at 1:1 ratio |
| Converging lens (f > 0) | f < u < 2f | Real, inverted, magnified | Projector, film projector, slide projector |
| Converging lens (f > 0) | u = f | Image at infinity (parallel rays) | Collimating light into a parallel beam (torches, searchlights) |
| Converging lens (f > 0) | u < f | Virtual, upright, magnified | Magnifying glass, eye loupe |
| Diverging lens (f < 0) | Any position | Always virtual, upright, diminished | Myopia (short-sightedness) correction; security peepholes |
| Concave mirror (f > 0) | u > 2f | Real, inverted, diminished | Satellite dish, radio telescope |
| Convex mirror (f < 0) | Any position | Always virtual, upright, diminished | Car wing mirrors, shop security mirrors |
Worked Example: Camera Lens
A camera lens has a focal length of 50 mm. An object is 2 m (2,000 mm) from the lens. Where does the image form?
Using 1/v = 1/f − 1/u = 1/50 − 1/2000 = 40/2000 − 1/2000 = 39/2000
v = 2000/39 ≈ 51.3 mm
The image forms 51.3 mm behind the lens (on the sensor). Magnification: m = −v/u = −51.3/2000 = −0.026 (the image is inverted and 1/38th the size of the object).
Note: as the object moves closer to the lens, the image moves further from the lens — this is why cameras need to "focus" by adjusting the distance between lens and sensor for different subject distances.
Worked Example: Magnifying Glass
A magnifying glass has a focal length of 10 cm. An object is placed 7 cm from the lens (inside the focal length). Where is the image?
1/v = 1/f − 1/u = 1/10 − 1/7 = 7/70 − 10/70 = −3/70
v = −70/3 ≈ −23.3 cm
The negative image distance means the image is on the same side as the object — a virtual image. The object viewer sees an upright, virtual image 23.3 cm from the lens.
Magnification: m = −v/u = −(−23.3)/7 = +3.33 (upright, magnified 3.33×).
Lens Power and Dioptre
Optometrists use power (measured in dioptres, D) rather than focal length. Power = 1/f, where f is in metres. A converging lens with focal length 0.25 m has power +4 D; a diverging lens with focal length −0.5 m has power −2 D.
For a pair of thin lenses in contact, total power = P₁ + P₂. This is why corrective lenses for both near-sightedness and astigmatism can be combined into a single lens — the powers simply add. Lens powers are added, not focal lengths.
Spectacle prescriptions use dioptre values: a prescription of −2.00 D means a diverging lens with focal length −0.5 m, used to correct myopia (short-sightedness). A prescription of +3.00 D means a converging lens with focal length 0.33 m, used for hyperopia (long-sightedness) or reading.
Real vs. Virtual Images
Real images
A real image is formed where light rays actually converge. It can be projected onto a screen — a cinema projector creates a real image on the cinema screen. Real images are always on the opposite side of the lens from the object (for a converging lens) and are inverted.
Virtual images
A virtual image is formed where light rays appear to diverge from, but no light actually passes through that point. It cannot be projected onto a screen. A virtual image is seen by looking through the lens — as in a magnifying glass or the virtual image in a plane mirror. Virtual images are always on the same side of the lens as the object (for a single lens) and are upright.
Applications in Optical Instruments
Human eye
The eye is a converging optical system. The cornea does most of the bending of light; the crystalline lens fine-tunes focus (accommodation) for different object distances. The image forms on the retina (about 17 mm behind the lens). The eye forms real, inverted images on the retina — the brain inverts them to produce the upright world we perceive.
In myopia, parallel rays from distant objects focus in front of the retina; in hyperopia, they would focus behind it. Corrective lenses shift the convergence point to land exactly on the retina.
Compound microscope
A microscope uses two converging lenses (objective and eyepiece) in sequence. The objective creates a real, magnified intermediate image of the specimen; the eyepiece acts as a magnifying glass to further magnify this intermediate image. Total magnification = objective magnification × eyepiece magnification.
Astronomical telescope
A refracting telescope uses a large objective lens to collect light and form an intermediate real image; the eyepiece magnifies this image for the observer. The primary function of the objective is to collect as much light as possible (large aperture) rather than magnification. Magnification = focal length of objective / focal length of eyepiece.
Common Questions
What is the difference between a converging and a diverging lens?
A converging (convex) lens is thicker in the middle than at the edges. Parallel light rays passing through it converge to a point — the focal point — on the far side. A diverging (concave) lens is thinner in the middle. Parallel rays spread out after passing through it; they appear to come from a virtual focal point on the same side as the incoming light. Converging lenses form both real and virtual images depending on object position; diverging lenses always form virtual images.
Why is the image in a concave mirror magnified when close but inverted when far?
When the object is inside the focal length (u < f), the reflected rays diverge and appear to come from a virtual focal point — producing a virtual, upright, magnified image (like a shaving/makeup mirror). When u > f, rays converge to form a real, inverted image. At exactly u = f, reflected rays are parallel (image at infinity). This is the same pattern as a converging lens — concave mirrors and converging lenses share the same thin lens/mirror formula.
Does the thin lens equation work for thick lenses?
The thin lens equation is an approximation that works well when the lens thickness is small compared to the object and image distances. For thick lenses, the equation still applies but distances must be measured from the principal planes (H and H') rather than from the physical lens surface. Camera lens designers use more complex ray tracing models that account for multiple lens elements, aberrations, and thick-lens geometry.
Calculate Image Distance and Magnification
Enter object distance and focal length to find image position and magnification for any lens or mirror configuration.
Open Lens and Mirror Calculator