Lens and Mirror Equation Calculator
Solve 1/f = 1/do + 1/di for focal length, object or image distance, with magnification, image height and a real, virtual, upright or inverted verdict.
1/dᵢ = 1/f − 1/dₒ
- 1/dᵢ = 1/10 − 1/30 = 0.066667 per cm, so dᵢ = 15 cm
- m = −dᵢ ÷ dₒ = −(15 cm) ÷ 30 cm = -0.5
- hᵢ = m · hₒ = -0.5 × 2 cm = -1 cm
- dᵢ is positive, so the image is real: it forms on the opposite side of the lens from the object and would land on a screen held there.
- m is negative, so the image is inverted — flipped top to bottom relative to the object.
- |m| = 0.5, so the image is reduced.
- f is positive, so this is a converging lens (thicker in the middle — a convex lens, rated 10 dioptres).
Where the image lands for a converging lens
| Object position | Image | Everyday example |
|---|---|---|
| Beyond 2f | Between f and 2f on the far side of the lens — real, inverted, reduced | A camera or the human eye |
| Exactly at 2f | At 2f on the far side of the lens — real, inverted, the same size | One-to-one copying |
| Between f and 2f | Beyond 2f on the far side of the lens — real, inverted, magnified | A film or slide projector |
| Exactly at f | No image forms — the rays leave parallel, so the image is at infinity | A collimator or a spotlight |
| Inside f | Behind the object on the same side — virtual, upright, magnified | A magnifying glass |
A diverging lens has no such table: with a real object it always produces a virtual, upright, reduced image between the focal point and the lens, no matter how far away the object is.
Sign convention: real-is-positive. Distances to real objects and real images are positive, virtual images are negative, f is positive for a converging optic (convex lens, concave mirror) and negative for a diverging one (concave lens, convex mirror), and m = −dᵢ ÷ dₒ so a negative m means inverted. The thin-lens equation assumes the optic has no thickness, that every ray is paraxial (close to the axis and nearly parallel to it), and that there is no spherical or chromatic aberration — so a real thick lens, a fast wide-aperture lens or a ray far off-axis will focus somewhere slightly different. Worked example: a converging lens with f = 10 cm and an object at 30 cm gives 1/dᵢ = 1/10 − 1/30, so dᵢ = 15 cm and m = −0.5 — a real, inverted, half-size image.
What is the Lens and Mirror Equation Calculator?
The thin-lens equation is 1/f = 1/dₒ + 1/dᵢ and the magnification is m = −dᵢ ÷ dₒ. A converging lens with f = 10 cm and an object 30 cm away forms its image at dᵢ = 15 cm with m = −0.5, so the image is real, inverted and half size.
- Solves 1/f = 1/dₒ + 1/dᵢ for focal length, object distance or image distance
- Magnification m = −dᵢ ÷ dₒ plus image height scaled from the object height
- Plain-English verdict: real or virtual, upright or inverted, magnified or reduced
- Works for converging and diverging lenses and for concave and convex mirrors
- Lens power in dioptres, mirror radius R = 2f and the classic object-position table
- 100% in-browser: distances, heights and results never leave your device
How to use the Lens and Mirror Equation Calculator
- 1
Choose a thin lens or a spherical mirror, then pick the unknown in the Solve for dropdown.
- 2
Enter the two quantities you already know and set the distance unit — millimetres, centimetres, metres or inches.
- 3
Use a positive focal length for a converging optic (convex lens, concave mirror) and a negative one for a diverging optic (concave lens, convex mirror).
- 4
Add the object height if you want the image height too, or leave it at zero to skip that part.
- 5
Read the answer, the magnification and the real or virtual verdict, then press Copy working for the full step-by-step.
About the Lens and Mirror Equation Calculator
The ByteTools Lens and Mirror Equation Calculator solves the thin-lens formula 1/f = 1/dₒ + 1/dᵢ for whichever of the three quantities you leave out, then reports the magnification m = −dᵢ ÷ dₒ and the resulting image height. It covers converging optics with a positive focal length and diverging optics with a negative one, and switches its wording between a thin lens and a spherical mirror.
Instead of a bare number you get a verdict in plain English: real or virtual, upright or inverted, magnified or reduced, alongside the lens power in dioptres or the mirror radius R = 2f. Awkward cases are handled honestly rather than papered over, so an object sitting on the focal point is reported as an image at infinity instead of a nonsense figure.
Every calculation is plain JavaScript running 100% locally in your browser. Nothing you type is uploaded, stored or logged, the numbers update as you type, and the page keeps working with no internet connection once it has loaded. The sign convention used throughout is the standard real-is-positive one, stated on the page so your working matches your textbook.
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, dₒ the object distance and dᵢ the image distance, all measured from the centre of the lens. The identical formula works for spherical mirrors, where the focal length is half the radius of curvature, f = R ÷ 2.
How do you tell whether an image is real or virtual?
Look at the sign of the image distance: a positive dᵢ is a real image that would land on a screen placed there, and a negative dᵢ is a virtual image that only appears to be at that spot. With a real object, a real image is always inverted and a virtual image is always upright.
What does a negative magnification mean?
Magnification is m = −dᵢ ÷ dₒ, so a negative value means the image is inverted — flipped top to bottom compared with the object. The size of the number sets the scale: above 1 in magnitude is magnified, below 1 is reduced, and exactly 1 is the same size as the object.
What happens when the object sits at the focal point?
Nothing comes to a focus. The rays leave the lens exactly parallel to one another, so they never meet and the image distance has no finite value, which is why this tool says the image is at infinity rather than printing a number. Shifting the object a little either way brings the image back to a measurable distance.
Can a diverging lens make a real image?
Not from a real object. A diverging lens with a negative focal length always gives a virtual, upright, reduced image between the lens and its focal point, however far away the object is. A real image only appears when the light arriving is already converging, which happens partway through a multi-lens system.
How accurate is the thin lens equation?
It is exact only for an idealised lens of zero thickness with paraxial rays, meaning rays close to the optical axis and nearly parallel to it. Real lenses have thickness, spherical aberration and chromatic aberration, so a fast wide-aperture lens or a ray far off-axis focuses slightly away from the predicted point. For coursework and rough optical layouts the difference is small.
Related tools
Snell's Law Calculator
Solve n₁sin θ₁ = n₂sin θ₂ for the refracted angle or either refractive index, with a critical angle, total internal reflection warning and wave speeds.
Wavelength and Frequency Calculator
Convert between wavelength and frequency using c = λf, with wave speed for vacuum, a medium, sound in air or a custom value, plus photon energy in eV.
Simple Pendulum Calculator
Find the period, length or local gravity of a simple pendulum from T = 2π√(L/g), with frequency, angular frequency and a large-amplitude correction.
Scientific Calculator
Free online scientific calculator with sin, cos, tan in degrees or radians, log, ln, powers, roots, π, e, parentheses, memory keys and keyboard support.
Unit Converter
Convert between units of length, weight, temperature, area, volume, speed, time and data storage instantly, with a swap button and common conversion tables.