Lens and Mirror Equation Calculator
- The thin-lens (and spherical-mirror) equation: 1/f = 1/dₒ + 1/dᵢ, with f = 20 cm (converging) and dₒ = 30 cm. Solving, dᵢ = 60 cm.
- Magnification m = −dᵢ ÷ dₒ = -2: the sign carries the orientation (negative = inverted) and the size scales the 5 cm object to 10 cm.
- The sign convention does the bookkeeping: positive image distance means the image forms on the far side (real, projectable); negative means virtual, on the object side — the magnifying-glass case when an object sits inside a converging lens's focal length.
Our lens mirror equation calculator solves the thin-lens and spherical-mirror equation, 1/f = 1/do + 1/di, and computes magnification using m = -di/do. Enter the focal length (f) and object distance (do), and the tool returns the image distance (di), magnification, and whether the image is real or virtual. The sign convention keeps everything consistent: f is positive for converging lenses and concave mirrors, negative for diverging lenses and convex mirrors, and a positive di means a real image on the far side. Real images can be projected on a screen; virtual images cannot. For example, a converging lens with f = 20 cm and an object at 30 cm forms a real image at 60 cm with magnification -2x, so a 5 cm object becomes a 10 cm inverted image. A diverging lens with f = -15 cm and the object at 30 cm produces a virtual image at -10 cm with magnification +0.33x, upright and reduced. An object at 8 cm from a converging lens with f = 10 cm (inside the focal length) creates a virtual image at -40 cm with magnification +5x, the classic magnifying glass effect. An object exactly at the focal point forms its image at infinity.
The thin-lens and spherical-mirror equation is the accepted standard taught in physics courses worldwide because it unifies lenses and mirrors under one consistent sign convention, giving correct predictions for real and virtual images alike. This page presents the full formula, walks through each calculation step by step, provides the worked examples above, and cites the sources behind the convention so you can verify every result.
Worked examples
Object outside the focal length of a converging lens
Image 60 cm away, magnification −2×: real, inverted and doubled — the projector case. The 5 cm object becomes a 10 cm image. (Converging lens / concave mirror (f > 0) · 20 cm · 30 cm · 5 cm)
| Image distance | 60 cm |
| Magnification | -2× |
| Image height | 10 cm |
| Image type | Real image (projectable on a screen) |
| Orientation | Inverted |
A diverging lens
Image at −10 cm: virtual, upright and reduced to a third — the negative sign is the whole story, and it is why diverging lenses can never project. (Diverging lens / convex mirror (f < 0) · 15 cm · 30 cm · 4 cm)
| Image distance | -10 cm |
| Magnification | 0.33× |
| Image height | 1.3 cm |
| Image type | Virtual image (same side as the object) |
| Orientation | Upright |
Object inside the focal length — a magnifying glass
Image at −40 cm, magnification +5×, virtual and upright: the same equation, with the object closer than f, produces the magnifier. (Converging lens / concave mirror (f > 0) · 10 cm · 8 cm · 3 cm)
| Image distance | -40 cm |
| Magnification | 5× |
| Image height | 15 cm |
| Image type | Virtual image (same side as the object) |
| Orientation | Upright |
The equation and the sign convention
The thin-lens and spherical-mirror equation is 1/f = 1/do + 1/di, where f is the focal length, do is the object distance, and di is the image distance. Magnification is m = -di/do. A reliable lens mirror equation calculator applies one sign convention and uses it consistently, because mixing conventions is the fastest way to get a wrong answer.
The sign convention used here is straightforward: f is positive for converging lenses and concave mirrors, and negative for diverging lenses and convex mirrors. A positive di means a real image on the far side, which can be projected on a screen. A negative di means a virtual image, which cannot be projected on a screen. Real images can be projected on a screen; virtual images cannot. Sign errors are the top student mistake with this equation, not the algebra itself. Forgetting that f is negative for a diverging lens, or dropping the negative sign on a virtual image distance, flips the entire result.
A verified example shows the convention at work. A converging lens with f = 20 cm and the object at 30 cm forms a real image at 60 cm, with magnification -2x (inverted, doubled): a 5 cm object becomes a 10 cm image. A diverging lens with f = -15 cm and the object at 30 cm forms a virtual image at -10 cm, with magnification +0.33x (upright, reduced).
The magnifying glass is the case most students find surprising. An object at 8 cm from a converging lens with f = 10 cm sits inside the focal length, and the math gives a virtual image at -40 cm with magnification +5x. The image is upright and enlarged, which is exactly what a magnifying glass produces. An object exactly at the focal point is the boundary case: its image forms at infinity.
Worked examples: projector, diverger, magnifier
The lens mirror equation calculator handles three classic optical setups that appear throughout physics coursework. Each example below applies the thin-lens / spherical-mirror equation, 1/f = 1/do + 1/di, with magnification m = -di/do. The sign convention used here keeps f positive for converging lenses and concave mirrors, negative for diverging lenses and convex mirrors, while a positive di means a real image on the far side.
The first case is the projector: a converging lens with f = 20 cm and the object at 30 cm. Solving gives di = 60 cm, so the image is real and can be projected on a screen. The magnification is -2x, meaning the image is inverted and doubled in size. A 5 cm object becomes a 10 cm image. Real images can be projected on a screen; virtual images cannot, which is why a projector relies on placing the object beyond the focal length.
The second case is the diverger: a diverging lens with f = -15 cm and the object at 30 cm. The equation yields di = -10 cm, giving a virtual image with magnification +0.33x. The image is upright and reduced to roughly one-third of the object's size. Because di is negative, the image sits on the same side as the object and cannot be projected on a screen.
The third case is the magnifier: a converging lens with f = 10 cm and the object at 8 cm, which places it inside the focal length. The result is a virtual image at di = -40 cm with magnification +5x. The image is upright and five times larger than the object, which is exactly how a simple magnifying glass works. For comparison, an object exactly at the focal point forms its image at infinity, producing no usable magnified image at a finite distance.
| Setup | di | m | Image type |
|---|---|---|---|
| Converging lens, projector | 60 cm | -2 | Real |
| Diverging lens, diverger | -10 cm | +0.33 | Virtual |
| Converging lens, magnifier | -40 cm | +5 | Virtual |
Magnification: the sign is information
Magnification tells you more than how big the image appears. The formula is m = -di/do, and the sign in front of the number carries real information about what you will see. A negative magnification means the image is inverted, flipped upside down relative to the object. A positive magnification means the image is upright, pointing the same way as the original. The absolute value of m gives the size ratio: |m| = 2 means the image is twice as tall as the object, and |m| = 0.5 means it is half as tall.
Because the thin-lens and spherical-mirror equation 1/f = 1/do + 1/di ties the image distance di to the focal length f and object distance do, the sign of di flows directly into magnification. A positive di means a real image on the far side, and that produces a negative m, so real images are always inverted. A negative di means a virtual image, and that produces a positive m, so virtual images are upright. Real images can be projected on a screen; virtual images cannot. When you use a lens mirror equation calculator, the magnification sign tells you which type you have before you ever set up a screen.
The verified examples make this concrete. A converging lens with f = 20 cm and an object at 30 cm forms a real image at 60 cm. The magnification is m = -60/30 = -2x, so the image is inverted and doubled. A 5 cm object becomes a 10 cm image. In contrast, a diverging lens with f = -15 cm and the object at 30 cm forms a virtual image at -10 cm. Here m = -(-10)/30 = +0.33x, so the image is upright and reduced to roughly one-third of the object height.
The magnifying glass case shows the same rule at work from the other direction. Place an object at 8 cm from a converging lens with f = 10 cm, which puts it inside the focal length. The image lands at -40 cm, and the magnification is m = -(-40)/8 = +5x. The positive sign confirms the image is upright, and the factor of 5 confirms it is enlarged. This is the classic upright, enlarged virtual image you see when you hold a magnifying lens close to an object.
One boundary case deserves attention. An object placed exactly at the focal point forms its image at infinity, so magnification is not a finite number you can read off. Move the object slightly inside or outside the focal length and a finite image returns, with its sign and size set by the same m = -di/do relationship.
- m = -di/do: sign tells orientation, absolute value tells size ratio
- Negative m: inverted image, always tied to a real image with positive di
- Positive m: upright image, always tied to a virtual image with negative di
- Image height = |m| × object height
Real versus virtual images
A lens mirror equation calculator gives you numbers, but understanding what those numbers mean in the real world matters just as much. The sign of the image distance di tells you whether the image is real or virtual. When di is positive, the image is real and forms on the far side of the lens (or in front of a concave mirror) — where light rays actually converge after passing through the lens or reflecting off the mirror. When di is negative, the image is virtual and appears on the same side as the object, where the light only seems to come from. The rays never actually meet there; your brain traces them backward to construct the image.
Real images can be projected on a screen, captured by a camera sensor, or detected by any device placed where the rays converge. A sheet of paper held at the image location will show the scene. Eyes and cameras work because real light arrives at the retina or sensor. Virtual images cannot be projected on a screen because no light rays physically meet at the image location. However, your eye can still see a virtual image because the lens of your eye refracts the diverging rays and focuses them onto the retina. A camera can also photograph a virtual image through its own lens, but you cannot catch one on a bare surface.
Consider the verified example of a converging lens with f = 20 cm and an object at 30 cm. The calculator returns di = 60 cm and magnification m = -2x, meaning a 5 cm object becomes a 10 cm inverted image. The positive di means real light rays converge 60 cm beyond the lens, so a screen placed there displays the image. Now compare that with a diverging lens of f = -15 cm and the same object distance of 30 cm. The result is di = -10 cm and m = +0.33x, an upright and reduced virtual image located 10 cm on the same side as the object. No screen will catch it, but an eye looking through the lens sees it.
The magnifying glass demonstrates the special case of a converging lens used inside its focal length. With f = 10 cm and the object at 8 cm, the calculator gives di = -40 cm and m = +5x: a large, upright virtual image far on the same side as the object. The rays leaving the lens diverge so strongly that the eye traces them back to an enlarged image it never physically reaches. One further boundary exists: when the object sits exactly at the focal point, the image forms at infinity, and no finite screen position will catch it.
- Real image (positive di): light rays converge where the image forms; a screen, camera sensor, or retina placed there detects it directly.
- Virtual image (negative di): rays only appear to come from the image location; no screen works, but an eye or camera lens can still see it.
- Object at the focal point: image at infinity — no finite detector location captures it.
The magnifying glass, explained by one sign flip
A magnifying glass looks like a simple tool, but the optics behind it come down to one sign flip in the thin-lens equation. The equation 1/f = 1/do + 1/di governs how converging lenses and concave mirrors form images, and the magnification formula m = -di/do tells you how large that image appears. When the object sits outside the focal length, everything behaves as you might expect: the image forms on the far side of the lens, and you can project it onto a screen. But when the object moves inside the focal length, the sign of di flips, and the lens stops acting like a projector and starts acting like a magnifier.
Consider a converging lens with f = 10 cm. Place the object at 30 cm — well outside the focal point — and the lens forms a real image at 60 cm with magnification -2x, meaning the image is inverted and doubled in size. Move the object to exactly 10 cm, the focal point, and the image shoots off to infinity. Now place the object at 8 cm, just inside the focal length, and run the same equation. The lens mirror equation calculator gives di = -40 cm and magnification +5x. The negative di signals a virtual image on the same side of the lens as the object, and the positive magnification means it is upright and enlarged. That is the magnifying glass: a converging lens with the object held inside one focal length.
The sign convention here is what makes the math work. Under this convention, f is positive for converging lenses and concave mirrors, negative for diverging lenses and convex mirrors. A positive di means a real image on the far side of the lens — the kind you can capture on a screen. A negative di means a virtual image on the near side, which cannot be projected but can be viewed directly by looking through the lens. The same logic applies to mirrors. A concave mirror with f = 20 cm and an object at 30 cm forms a real image at 60 cm with magnification -2x, just like the converging lens.
In practice, the large negative di is what gives a magnifying glass its power. Because the virtual image sits 40 cm behind the actual object for the f = 10 cm example, the magnification reaches +5x. A 5 cm object viewed through that lens appears as a 25 cm virtual image. The closer the object gets to the focal point — without crossing it — the farther the virtual image moves back and the larger the magnification grows. Cross the focal point, though, and the image becomes real again, inverted, and projectable. One sign flip separates a magnifying glass from a projection lens.
Mirrors obey the same equation
Mirrors obey the same equation that lenses do, so a lens mirror equation calculator handles both with one formula. The thin-lens and spherical-mirror equation is 1/f = 1/do + 1/di, where f is the focal length, do is the object distance, and di is the image distance. Magnification is m = -di/do. The sign convention keeps everything consistent: f is positive for converging lenses and concave mirrors, and negative for diverging lenses and convex mirrors. A positive di means a real image forms on the far side, while a negative di means a virtual image forms on the near side.
That sign convention maps directly onto the mirrors you see every day. A concave mirror is a converging mirror, with a positive focal length. A makeup mirror is the classic case: when you hold your face close, inside the focal length, you see a larger, upright reflection. A convex mirror is a diverging mirror, with a negative focal length. The passenger-side mirror on a car is the familiar example, giving you a wider field of view with a reduced, upright image.
The same verified examples that work for lenses apply here. A converging lens with f = 20 cm and the object at 30 cm forms a real image at 60 cm, with magnification -2x, meaning a 5 cm object becomes a 10 cm image that is inverted and doubled. A diverging lens with f = -15 cm and the object at 30 cm forms a virtual image at -10 cm, with magnification +0.33x, upright and reduced. An object at 8 cm from a converging lens with f = 10 cm, placed inside the focal length, forms a virtual image at -40 cm with magnification +5x, which is how a magnifying glass works.
The same patterns hold for mirrors. A concave mirror with the object beyond the focal point produces a real image that can be projected on a screen. Move that object inside the focal length and the image becomes virtual, upright, and enlarged, which is the makeup mirror effect. A convex mirror always produces a virtual, upright, reduced image, matching the car passenger mirror. One boundary case applies to both lenses and mirrors: an object placed exactly at the focal point forms its image at infinity. Real images can be projected on a screen, while virtual images cannot.
FAQs
How do I find the image distance?
Use the lens and mirror equation and solve for the image distance: 1/di = 1/f - 1/do. For example, if the focal length f is 20 cm and the object distance do is 30 cm, then 1/di = 1/20 - 1/30, which gives di = 60 cm. The calculator handles this algebra automatically once you enter the known values.
What does a negative image distance mean?
A negative image distance means the image is virtual and forms on the same side as the object. In the diverging lens example, the image distance is -10 cm. Because the image is virtual, it cannot be projected on a screen. The calculator reports the negative sign so you can tell a virtual image from a real one.
What does negative magnification mean?
Negative magnification means the image is inverted relative to the object. For example, a magnification value of m = -2 means the image is inverted and twice the object size. The sign tells you the orientation, while the absolute value tells you how much larger or smaller the image is compared to the object.
When is a lens a magnifying glass?
A lens acts as a magnifying glass when the object is placed inside the focal length. For example, at 8 cm from a lens with f = 10 cm, the image is virtual, upright, and magnified 5x. The calculator will show a negative image distance and a positive magnification greater than one in this situation.
Does the same equation work for mirrors?
Yes, the same equation works for mirrors. Concave mirrors take f > 0 and convex mirrors take f < 0, using the same magnification formula as lenses. The calculator applies these sign conventions automatically, so you can switch between lens and mirror problems by entering the focal length with the correct sign.
What if the object is exactly at the focal point?
When the object is placed exactly at the focal point, the image forms at infinity because the emergent rays are parallel. In the calculator, entering an object distance equal to the focal length will produce an undefined or infinite image distance, which signals that no real image forms at a finite location.