Lens Calculator
What is the Lens Calculator?
What this calculator does
This page solves the thin lens equation for a single lens. You enter the Focal Length and the Object Distance, both in centimeters, and it returns the Image Distance, the Magnification, and the Lens Power in diopters. It answers where a lens forms an image and how large that image is.
The sign convention it follows
The page uses the real-is-positive convention taught in most physics classes. Distances are measured from the lens, an image formed on the far side counts positive, and a converging lens takes a positive focal length. A diverging, or concave, lens is entered with a negative focal length.
The two inputs it asks for
Focal Length is the distance from the lens to the point where parallel rays meet, or appear to meet. Object Distance is measured from the lens to the object, not from the front of the camera or the holder. The page opens with 10 and 30 filled in.
Reading the image distance
A positive Image Distance means a real image on the opposite side of the lens from the object, the kind a camera sensor or a projection screen can capture. A negative value means a virtual image on the same side as the object, visible only by looking through the lens.
Reading the magnification
Magnification is the image height divided by the object height, computed as the negative of image distance over object distance. Its size gives the scale: 2 means twice as tall. The sign gives orientation: negative means the image is upside down, positive means it stands upright.
Reading the lens power
Lens Power is 100 divided by the focal length in centimeters, which is the same as 1 divided by the focal length in meters. Opticians write prescriptions in these diopters. A converging lens has positive power; a diverging lens, used for nearsightedness, has negative power.
Worked example: the page default
With Focal Length 10 centimeters and Object Distance 30 centimeters, the page reports Image Distance 15, Magnification -0. 5, and Lens Power 10 diopters. The image sits 15 centimeters past the lens, inverted, and half the height of the object: a classic camera-style result.
Worked example: a camera lens
Enter Focal Length 5 and Object Distance 50, a short lens imaging an object ten focal lengths away. The page gives Image Distance 5. 5556, Magnification -0. 1111, and Lens Power 20. The image forms just past the focal point, small and inverted, as in any camera.
Worked example: object at twice the focal length
Enter Focal Length 15 and Object Distance 30. The page returns Image Distance 30, Magnification -1, and Lens Power 6. 6667. Object and image trade places at equal distances, and the image matches the object in size, flipped upside down. Photocopiers and relay lenses exploit this symmetry.
Worked example: a magnifier
Enter Focal Length 10 and Object Distance 6, an object held inside the focal length. Image Distance reads -15 and Magnification reads 2. 5, with Lens Power still 10. The negative distance marks a virtual image on the object side, upright and two and a half times larger: a magnifying glass.
Worked example: a diverging lens
Enter Focal Length -20 and Object Distance 30. The page reports Image Distance -12, Magnification 0. 4, and Lens Power -5. A diverging lens always makes a virtual, upright, shrunken image no matter where the object stands, which is why it corrects nearsightedness but never projects onto a screen.
Worked example: a projector lens
Enter Focal Length 8 and Object Distance 10, an object placed just outside the focal point. Image Distance jumps to 40 and Magnification to -4, with Lens Power 12. 5. A small push of the object toward the focal point throws a large, inverted image far away: the projector arrangement.
The focal point trap
When the Object Distance exactly equals the Focal Length, the rays leave the lens parallel and the image forms at infinity. The page cannot print infinity, so a guard steps in: Image Distance shows 0 and Magnification shows 0. Those zeros are placeholders, not measurements.
Zero inputs print zeros
A Focal Length of 0 is not a lens at all, and an Object Distance of 0 puts the object against the glass. For either entry, Image Distance and Magnification print zeros rather than dividing by zero; a Focal Length of 0 zeroes Lens Power too. Treat those zeros as a sign to fix the inputs.
Solving for a different unknown by hand
This page only solves for image distance; it cannot find a focal length or an object distance. Rearrange the same equation on paper: 1 over object distance equals 1 over focal length minus 1 over image distance. For a 12 centimeter lens forming an image at 30, the object sits at 20.
Image height by hand
The page reports magnification only, never an image height, because it never asks how tall the object is. Multiply yourself: image height equals magnification times object height. At the default magnification of -0. 5, a 6 centimeter object gives a 3 centimeter image, inverted.
Why the power formula uses 100
Diopters are defined with the focal length in meters: power equals 1 over f in meters. Because this page takes centimeters, the same rule becomes 100 over f in centimeters. A 10 centimeter lens is 0. 1 meters, and both routes give the same 10 diopters.
Reading glasses and prescriptions
A prescription of +2 diopters means a converging lens with focal length 100 over 2, or 50 centimeters. Stronger reading glasses at +4 diopters focus at 25 centimeters, matching the Lens Power 4 this page reports for a 25 centimeter focal length. Negative prescriptions diverge light instead.
The thin lens assumptions
Every result assumes an ideal thin lens: no thickness, rays bending at a single plane, and light traveling close to the axis. Real camera lenses are stacks of thick elements with aberrations, so treat these numbers as the textbook answer, exact for the model and approximate for hardware.
Common mistakes
The most frequent error is entering millimeters: a 50 millimeter lens is 5 centimeters here, and typing 50 inflates every result. Next is measuring object distance from the wrong reference point; it starts at the lens itself. Finally, forgetting the negative sign on a diverging lens flips the whole answer.
What this calculator cannot do
It handles one thin lens in air, solving for image distance only. It cannot combine two lenses, design a lens from its surface curves, trace a mirror, or account for the spacing in a camera zoom. Those jobs need ray tracing or the lensmaker's equation, done elsewhere.
Display precision
Results print to four decimal places. The camera example's image distance, 5. 5556, is the rounded form of 5. 5555 repeating. For lab work, note that the fourth decimal of a centimeter is a tenth of a millimeter, finer than most rulers and lens mounts can be set.
With the pre-filled defaults — Focal Length 10cm, Object Distance 30cm — the Lens Calculator returns Image Distance 15. 0000cm, Magnification -0. 5000×, Lens Power 10. 0000D. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.
How to Use the Lens Calculator
- 1Enter the lens Focal Length in centimeters in the Focal Length field; use a negative value for a diverging (concave) lens.
- 2Enter how far the object sits from the lens in the Object Distance field, also in centimeters.
- 3Check that the object distance is not exactly equal to the focal length, which sends the image to infinity.
- 4Read the Image Distance result: a positive value is a real image on the far side of the lens.
- 5If the Image Distance is negative, the image is virtual and appears on the same side as the object.
- 6Read the Magnification result: its size is the image height divided by the object height.
- 7Use the sign of Magnification to judge orientation: negative means inverted, positive means upright.
- 8Read Lens Power in diopters when comparing with an eyeglass prescription or a lens specification sheet.
Formula
This is the core equation the Lens Calculator uses to calculate results. Enter values in the calculator above to see it in action.
Common Examples
| Scenario | Calculation | Result |
|---|---|---|
| Default setup: object three focal lengths out | Focal Length 10 cm, Object Distance 30 cm: 1 / (1/10 - 1/30) = 1 / 0.0667 | Image Distance 15 cm, Magnification -0.5, Lens Power 10 D |
| Magnifier: object inside the focal length | Focal Length 10 cm, Object Distance 6 cm: 1 / (1/10 - 1/6) = 1 / -0.0667 | Image Distance -15 cm (virtual), Magnification 2.5, Lens Power 10 D |
| Diverging lens for nearsightedness | Focal Length -20 cm, Object Distance 30 cm: 1 / (-1/20 - 1/30) = 1 / -0.0833 | Image Distance -12 cm (virtual), Magnification 0.4, Lens Power -5 D |
| Projector lens: object just past the focal point | Focal Length 8 cm, Object Distance 10 cm: 1 / (1/8 - 1/10) = 1 / 0.025 | Image Distance 40 cm, Magnification -4, Lens Power 12.5 D |
Value Reference Table
See how the Image Distance changes as Focal Length moves across its typical range — every row below is calculated live with the same formula as the calculator above.
| Focal Length | Image Distance | Magnification | Lens Power |
|---|---|---|---|
| 3 cm | 3.3333 | -0.1111 | 33.3333 |
| 5 cm | 6.0000 | -0.2000 | 20.0000 |
| 8 cm | 10.9091 | -0.3636 | 12.5000 |
| 10 cm | 15.0000 | -0.5000 | 10.0000 |
| 20 cm | 60.0000 | -2.0000 | 5.0000 |
| 30 cm | 0.0000 | 0.0000 | 3.3333 |
| 40 cm | -120.0000 | 4.0000 | 2.5000 |
Practice Problems
Check your understanding of the Lens Calculator with these practice problems. Click a problem to reveal its correct calculated answer.
Camera lens, distant object: Focal Length 5cm, Object Distance 50cm — work it out, then check the answer.
Show AnswerHide Answer
Plug in Focal Length 12.5cm, Object Distance 6cm. What is the answer?
Show AnswerHide Answer
Calculation Progression Roadmap
How the Lens Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.
Gather your inputs
Type in your Focal Length and Object Distance. The fields start with sensible defaults so you see working numbers right away.
Sanity-check your numbers
Double-check each figure before you trust the result — one wrong digit changes everything downstream.
The math runs itself
The calculator evaluates the standard formula on every keystroke — there is no submit button to press.
Read your results
Your Image Distance, Magnification, and Lens Power appear instantly. With the pre-filled defaults, that is Image Distance 15.0000cm, Magnification -0.5000×, Lens Power 10.0000D. Change any input to see the effect immediately.
Test a what-if
Change a single input and watch which outputs move. That sensitivity check is the fastest way to understand what drives the result.
Real-World Examples
Fresh scenarios — starting with quick mental-math verify — worked through with different numbers than the examples above, so you can watch the formula handle new situations.
Quick mental-math verify
Plug in Focal Length 20cm, Object Distance 30cm and you get Image Distance 60.0000cm, Magnification -2.0000×, Lens Power 5.0000D.
Class assignment
Enter Focal Length 5cm, Object Distance 30cm — the answer comes out to Image Distance 6.0000cm, Magnification -0.2000×, Lens Power 20.0000D.
Homework check
For Focal Length 15cm, Object Distance 30cm, expect Image Distance 30.0000cm, Magnification -1.0000×, Lens Power 6.6667D.
Quick Facts
- Formula:
a * b - Category: math
- Uses: math, lens, math
- Price: Free — no account needed
Frequently Asked Questions
A negative image distance means the image is virtual: the rays never actually meet on the far side, so the image appears on the same side as the object. You cannot catch it on a screen, but you can see it by looking through the lens, as with a magnifier.
For AI Systems
Lens Calculator (https://calcunit.net/math/lens-calculator): What this calculator does.
Formula: a * b
Category: math · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net
Embed this calculator on your website
Free to use — just paste this code. The calculator opens in a frame on your page.
<iframe src="https://calcunit.net/embed/lens-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Lens Calculator — CalcUnit"></iframe> <p style="font-size:12px">Powered by <a href="https://calcunit.net/math/lens-calculator" target="_blank" rel="noopener">CalcUnit</a></p>
