Image Distance Calculator
Enter a lens or mirror’s focal length and the object distance, and this calculator returns the image distance: where the image forms, from the thin lens equation 1/f = 1/u + 1/v. It is a geometric optics tool for lenses and spherical mirrors, nothing to do with the travel or map distance calculator: every distance here is measured from the lens, in centimeters.
The badge under the result restates what the sign and size of the answer mean (real or virtual, inverted or upright, magnified or diminished). It reads the same numbers the tool computes and changes none of them. Magnification itself is not a tool output; the formula section shows how to get it by hand.
Quick Answer
A converging lens with a focal length of 10 cm and an object 20 cm away forms its image 20.00 cm on the other side of the lens: a real, inverted image the same size as the object. The calculator above is pre-filled with this exact run. Move the object closer, to 15 cm, and the image retreats to 30.00 cm; move it inside the focal length, to 5 cm, and the answer flips to −10.00 cm, a virtual image on the same side as the object.
Key takeaways
- The tool solves one equation, the thin lens equation 1/f = 1/u + 1/v, rearranged as 1/v = 1/f − 1/u. It needs only the focal length and the object distance, both in centimeters.
- The sign of the answer is the physics: positive means a real image that can land on a screen, negative means a virtual image your eye sees looking back through the lens.
- An object exactly at the focal point returns Infinity. The rays leave the lens parallel, so there is no image to measure a distance to.
- An earlier version of this page printed a different formula and a worked answer of 6.67 cm for the example above. That text was wrong; the calculator itself has always computed the standard equation, and the correct answer is 20.00 cm. The correction is documented in the formula section.
- Quick Answer
- How to use the image distance calculator
- The formula: one equation, one sign convention
- Worked example: the 10 cm lens, plus five more runs
- The five object positions, and what each one is for
- Reading the answer: sign first, then magnification by hand
- Using the same tool for spherical mirrors
- What competing calculators miss
- Frequently asked questions
- Add This Calculator to Your Website
- References
How to use the image distance calculator
Enter the focal length and the object distance in centimeters, then click Calculate. The image distance appears in the third field, with a short badge under it naming the kind of image you got.
- Focal length: positive for a converging lens (convex) or a concave mirror, negative for a diverging lens (concave) or a convex mirror. The packaging or lab sheet for a school lens usually prints it; for an unmarked lens, the ball lens focal length calculator covers the special case of a spherical glass ball.
- Object distance: measure from the object to the center of the lens, not to the lens holder, and enter it as a positive number for an ordinary object in front of the lens.
- Read the sign before the size: a positive result is a real image distance on the far side; a negative result is a virtual image the same number of centimeters on the object side.
- Try the focal point: set the object distance equal to the focal length and the tool returns Infinity. Nudge the object distance just inside it and the answer jumps to a large negative number, which is the magnifying-glass regime.
Photographers meet the same equation from the other side: focusing a camera moves the lens until the image distance matches the sensor position. The hyperfocal distance calculator uses that geometry to find the focus distance that keeps a whole scene acceptably sharp.
The formula: one equation, one sign convention
The tool uses the thin lens equation in the real-is-positive convention taught in standard texts such as OpenStax University Physics, in the Thin Lenses section: object and image distances are positive when they sit on the side where the light actually goes.
Solved for image distance: 1/v = 1/f − 1/u, so v = 1 ÷ (1/f − 1/u), equivalently v = (f × u) ÷ (u − f)
By hand for magnification: m = −v ÷ u (the tool does not output this; see below)
Where f is the focal length, u the object distance and v the image distance, all in the same unit. The sign rules that go with the convention:
| Quantity | Positive when | Negative when |
|---|---|---|
| Focal length f | Converging (convex) lens, concave mirror | Diverging (concave) lens, convex mirror |
| Object distance u | Real object in front of the lens (the normal case) | Virtual object, an advanced multi-lens situation |
| Image distance v | Real image, far side of the lens, projectable | Virtual image, object side, seen only by looking through the lens |
A correction to this page’s earlier text. The previous version of this article printed the formula as 1/f = 1/v − 1/u while still telling readers to enter the object distance as a positive number, and its worked example concluded that a 10 cm lens with the object at 20 cm forms an image at 6.67 cm. With positive distances that formula and that answer belong to a different sign convention used inconsistently: under the Cartesian convention the object distance itself carries a negative sign, and 1/v = 1/f + 1/u with u = −20 cm gives the same 20.00 cm this tool returns. The 6.67 cm figure comes from feeding a positive object distance into the Cartesian rearrangement, a classic sign slip. The calculator’s code was never changed by any of this: it has always computed 1/v = 1/f − 1/u, which is the real-is-positive equation above, and 6.67 cm does appear in the tool, as the correct answer for a diverging lens (f = −10 cm, u = 20 cm, v = −6.67 cm) and for a virtual object (f = 10 cm, u = −20 cm).
Worked example: the 10 cm lens, plus five more runs
The pre-filled run is a convex lens of focal length 10 cm with the object 20 cm away. By hand: 1/v = 1/10 − 1/20 = 0.05, so v = 20.00 cm, exactly what the tool shows.
Because the object sits at exactly twice the focal length, the geometry is symmetric: image distance equals object distance and the magnification m = −v/u = −1, an inverted image the same size as the object. Every row below is a verified run of the calculator above:
| Focal length | Object distance | Image distance | What forms |
|---|---|---|---|
| 10 cm | 20 cm | 20.00 cm | Real, inverted, same size |
| 10 cm | 15 cm | 30.00 cm | Real, inverted, magnified 2 times |
| 10 cm | 30 cm | 15.00 cm | Real, inverted, diminished |
| 10 cm | 5 cm | −10.00 cm | Virtual, upright, magnified 2 times |
| −10 cm (diverging) | 20 cm | −6.67 cm | Virtual, upright, diminished |
| 20 cm | 100 cm | 25.00 cm | Real, inverted, diminished (the camera case) |
Watch the image distance fall as the object backs away from a 10 cm lens, and notice it can never drop below the focal length itself:
The five object positions, and what each one is for
For a converging lens, the object’s position against the focal length decides everything about the image. The table is the standard summary found in treatments like the HyperPhysics thin lens equations, and every row can be reproduced in the tool.
| Object position | Image | Everyday device |
|---|---|---|
| Beyond 2f | Real, inverted, diminished, between f and 2f | Camera: a distant scene squeezed onto a small sensor |
| Exactly at 2f | Real, inverted, same size, at 2f | Photocopiers and 1:1 macro setups |
| Between f and 2f | Real, inverted, magnified, beyond 2f | Projector: a small slide thrown large onto a far screen |
| Exactly at f | No image; rays emerge parallel (tool returns Infinity) | Searchlights and collimators, run in reverse |
| Inside f | Virtual, upright, magnified, same side as the object | Magnifying glass |
Reading the answer: sign first, then magnification by hand
A positive image distance means the rays genuinely meet on the far side of the lens, so the image is real and can be caught on paper or a sensor. A negative value means the rays only appear to meet, on the object side: a virtual image, upright, visible only by looking through the lens.
The tool stops at the distance. Magnification takes one more division, m = −v/u, and it is worth doing by hand because the sign carries the orientation: the worked example gives m = −20/20 = −1 (inverted, life-size), the 15 cm run gives m = −2 (inverted, doubled), and the inside-the-focal-length run gives m = +2 (upright, doubled), which is why a magnifying glass works at all. A diverging lens never flips the sign: with f negative the answer is negative at every object distance, always virtual, upright and diminished, the peephole and nearsightedness-correction case.
Using the same tool for spherical mirrors
The mirror equation has the identical shape, 1/f = 1/u + 1/v, so this calculator returns correct image distances for spherical mirrors as well, with the mirror sign habits: f is positive for a concave (converging) mirror and negative for a convex one, and a positive v means the image sits in front of the mirror where the reflected light actually goes.
Two honest limits apply to both lenses and mirrors. The equation is a thin-lens, paraxial model: it assumes rays stay close to the axis and the lens is thin compared with the distances involved, so real camera lenses, with several elements and a marked principal plane, agree with it closely but not to the last decimal. And the tool works in centimeters only; a focal length quoted in millimeters, as camera lenses are, needs dividing by 10 before entry, which is a unit conversion, not a different formula, as the NIST guidance on metric unit conversions sets out.
What competing calculators miss
Most thin-lens tools compute the same equation this one does. The differences are in what they add around it, and in two outright errors worth knowing about:
- NumericCore’s thin lens calculator is the strongest rival: it solves for any of the three variables, adds magnification and a real/virtual readout, and its worked example (f = 10 cm, object at 15 cm, image at 30 cm) checks out against this tool exactly. Its extra modes are genuinely useful; it never explains the sign convention behind its negative answers, though, which is where students actually get stuck.
- OnlyCalculators’ thin lens tool adds a five-case table and a full show-your-work breakdown, and its numbers (f = 20 cm, object at 30 cm, image at 60 cm) also reproduce here. The cost is a heavy page, and its magnification sign convention appears without warning mid-page.
- CtrlCalculator’s thin lens page states the equation correctly, then prints a results table that disobeys it: object 15 cm with f = 8 cm is listed as a 24 cm image distance when the equation gives 17.14 cm, and its diverging-lens row is off by the same kind of margin. A table that cannot survive its own formula is a reason to recompute any number you take from it.
- Machine-vision focal length solvers (the FIRGELLI style) solve the same physics for sensor sizes and fields of view. They are excellent for camera engineering and useless for a homework problem that simply asks where the image forms.
- The gap this page fills: one job done plainly, with the sign convention printed next to the formula, each result classified in words, and a public correction of the wrong formula and worked answer this page itself used to carry. A tool that shows its convention can be checked; one that hides it has to be trusted.
Frequently asked questions
The distance from the center of the lens (or mirror) to the place where the image forms, measured along the axis. In this calculator it is the v in the thin lens equation 1/f = 1/u + 1/v, returned in centimeters. A screen placed at a positive image distance catches a sharp real image.
It uses the thin lens equation 1/f = 1/u + 1/v, rearranged as 1/v = 1/f − 1/u, under the real-is-positive convention: focal length is positive for a converging lens, object distance is positive for a real object, and a positive result means a real image. An earlier note on this page printed a Cartesian-style formula alongside positive object distances, which was inconsistent; the tool’s arithmetic never changed.
A negative result is a virtual image: the outgoing rays diverge, and the image appears on the same side of the lens as the object. It happens with any diverging lens, and with a converging lens whenever the object sits inside the focal length, which is the magnifying-glass case. The image is upright and cannot be projected onto a screen.
The calculator returns Infinity. Rays from an object at the focal point leave the lens parallel to each other, so they never meet to form an image at any finite distance. Move the object slightly farther out and a real image appears very far away; move it slightly in and a large virtual image appears instead.
Yes. Enter the focal length as a negative number. The image distance then comes out negative at every object distance, because a diverging lens always forms a virtual, upright, diminished image on the same side as the object. A −10 cm lens with the object at 20 cm gives −6.67 cm.
Yes, for spherical mirrors. The mirror equation has the same form, 1/f = 1/u + 1/v. Enter the focal length as positive for a concave mirror and negative for a convex mirror; half the mirror’s radius of curvature is its focal length. A positive result then means the image forms in front of the mirror.
No, the tool returns the image distance only. Magnification is one extra step by hand: m = −v/u. The worked example gives m = −20/20 = −1, an inverted image the same size as the object; a positive m means upright, and the size of m is the ratio of image height to object height.
Two sign conventions are in common use. This page uses real-is-positive, where 1/f = 1/u + 1/v with ordinary positive distances. Cartesian texts write 1/f = 1/v − 1/u and give the object distance a negative sign, so both conventions produce the same image distance when each is used consistently. Mixing the two, as this page once did in its notes, is what produces wrong answers like 6.67 cm for the worked example.
Add This Calculator to Your Website
Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.
Powered by Calculator Zilo
References
- OpenStax, University Physics Volume 3. Thin Lenses: the thin lens equation and the real-is-positive sign convention. Accessed October 22, 2026.
- OpenStax, College Physics 2e. Image Formation by Lenses. Accessed October 22, 2026.
- C. R. Nave, HyperPhysics, Georgia State University. Thin Lens Equations. Accessed October 22, 2026.
- C. R. Nave, HyperPhysics, Georgia State University. Lens Concepts. Accessed October 22, 2026.
- RP Photonics. Focal Length, RP Photonics Encyclopedia. Accessed October 22, 2026.
- National Institute of Standards and Technology. NIST Guide to the SI, Appendix B: Conversion Factors. Accessed October 22, 2026.
