Optical Calculator
What is the Optical Calculator?
What this calculator does
Enter a lens's Focal Length (f) and an Object Distance (dₒ), both in centimeters. The tool applies the thin lens equation and returns the Image Distance (dᵢ), the Magnification, and the Lens Power in diopters.
The thin lens equation does the work
The governing relation is 1 / f = 1 / dₒ + 1 / dᵢ. Rearranged, the image distance becomes 1 / (1 / f minus 1 / dₒ), which is exactly the formula this page runs. Give it any two of the three distances and the third is fixed.
Thin means thickness is ignored
A real lens has two curved surfaces and real glass between them; the thin lens model collapses all of that into a single plane. For ordinary camera, eye, and classroom lenses the approximation is excellent, and it is the standard model in introductory optics courses.
The default setup, read slowly
The page opens with Focal Length (f) 10 centimeters and Object Distance (dₒ) 30 centimeters. The Image Distance (dᵢ) comes out 15. 0000 centimeters, the Magnification −0. 5000, and the Lens Power 10. 0000 diopters. An object three focal lengths away images at one and a half focal lengths.
A negative magnification means inverted
Magnification is computed as −dᵢ / dₒ, so the default's −0. 5000 describes an image half the object's height and flipped upside down. The minus sign carries the orientation; the size of the number carries the scale. Positive magnification, covered below, means an upright image.
Lens power is focal length turned upside down
Lens Power equals 100 / f when f is in centimeters, which is 1 / f with f in meters. That reciprocal is the diopter, the unit optometrists prescribe in. The default 10 centimeter lens is therefore a strong 10. 0000 diopter lens.
Worked example: a projector lens
Set Focal Length (f) 10 centimeters and Object Distance (dₒ) 15 centimeters, an object just outside the focal point. The Image Distance (dᵢ) stretches to 30. 0000 centimeters and the Magnification to −2. 0000: a real image, twice life size, thrown onto a screen.
Worked example: the object at twice the focal length
With Focal Length (f) 25 centimeters and Object Distance (dₒ) 50 centimeters, the Image Distance (dᵢ) lands at 50. 0000 centimeters and the Magnification at exactly −1. 0000. Object and image trade places symmetrically, and the Lens Power reads a mild 4. 0000 diopters.
Worked example: a camera-style lens
A Focal Length (f) of 5 centimeters with the Object Distance (dₒ) at 20 centimeters gives an Image Distance (dᵢ) of 6. 6667 centimeters and a Magnification of −0. 3333. Distant scenes compress toward the focal plane, which is why camera images form just past f.
Worked example: the magnifying glass
Hold a Focal Length (f) 4 centimeter lens just 3 centimeters from the page, inside its focal length. The Image Distance (dᵢ) returns −12. 0000 centimeters and the Magnification +4. 0000: an upright, virtual image four times life size, which is exactly how a loupe is used.
A negative image distance means virtual
When the Image Distance (dᵢ) comes out negative, no screen can catch the image; the rays never actually meet on the far side. The image appears on the same side as the object, visible only by looking through the lens, as in the magnifier example.
Diverging lenses take a negative focal length
A concave, diverging lens is entered with a negative Focal Length (f). Try f −10 centimeters with an Object Distance (dₒ) of 30 centimeters: the Image Distance (dᵢ) is −7. 5000 centimeters, the Magnification +0. 2500, and the Lens Power −10. 0000 diopters, an upright shrunken virtual image.
An object exactly at the focal point breaks the pattern
Set Object Distance (dₒ) equal to Focal Length (f) and the image forms at infinity; no finite distance exists. This tool guards that case and displays an Image Distance (dᵢ) of 0 rather than a number, so read a flat 0. 0000 there as infinity, not as zero distance.
Everything is in centimeters
Both inputs and the Image Distance (dᵢ) result are centimeters, while Lens Power silently converts to meters before reciprocating. A 50 millimeter camera lens must be entered as 5, not 50; entering millimeters inflates the focal length tenfold and moves every image ten times too far.
Reading glasses, checked by hand
A common +2 diopter reading lens should have a focal length of 1 / 2 meters, which is 50 centimeters. Enter Focal Length (f) 50 and the Lens Power result returns 2. 0000 diopters, confirming the conversion. The same trick runs any prescription backward into a focal length.
Magnification scales lengths, not areas
The Magnification result is a linear ratio: at −2. 0000 a 3 centimeter object throws a 6 centimeter image, upside down. Areas scale with the square, so that image covers four times the area. Multiply object height by magnification yourself when you need an image height in centimeters.
The sign convention is real-is-positive
Distances measured to the side where light actually goes count positive here; virtual images and diverging lenses take negative values. Other textbooks use different conventions and will quote the same physics with different signs, so match conventions before comparing numbers between sources or instructors.
What this tool leaves out
There is no mirror mode with its own sign rules, no thick-lens correction, no lensmaker's equation working backward from glass and curvature, and no aberration or aperture modeling. Spherical and chromatic errors, depth of field, and f-numbers belong to richer tools; this page is the thin lens core.
Eyeglass prescriptions are the everyday use
Optometrists write lens power directly in diopters, so the Lens Power line is the bridge between this physics page and a real prescription. A −10. 0000 diopter result corresponds to the strong diverging correction used for high myopia, always ground to measurements taken in an eye exam.
Four decimals ride on every result
Image Distance (dᵢ), Magnification, and Lens Power all print to four decimal places, so 15 centimeters appears as 15. 0000. Treat the decimals as exact arithmetic on your inputs, not as a claim that a school ruler or a lens bench measured anything to a ten-thousandth of a centimeter.
Where the diopter is defined
The diopter is simply one reciprocal meter, recognized in the SI Brochure published by the BIPM as a unit accepted for use with the SI in optics. That definition is all the Lens Power result uses: power in diopters is 1 divided by focal length in meters.
Prescription powers add when lenses stack
Two thin lenses in contact behave like one lens whose power is the sum of the two Lens Power values, which is why trial lenses in an eye exam add so neatly. Two +2. 0000 diopter lenses stacked act as +4. 0000 diopters, focusing at 25 centimeters instead of 50.
The bottom line
Two inputs, three results, one equation. Enter Focal Length (f) and Object Distance (dₒ) in centimeters, then read where the image forms, how large and which way up it stands, and how strong the lens is in diopters. Watch the signs; they carry half the information.
With the pre-filled defaults — Focal Length (f) 10cm, Object Distance (dₒ) 30cm — the Optical Calculator returns Image Distance (dᵢ) 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 Optical Calculator
- 1Enter the lens strength you are studying in the Focal Length (f) field, in centimeters, using a negative value for a diverging lens.
- 2Convert millimeters to centimeters first if your lens is marked in millimeters: a 50 millimeter lens is entered as 5.
- 3Enter how far the object sits from the lens in the Object Distance (dₒ) field, also in centimeters.
- 4Keep the object inside the focal length only when you intend a magnifier; otherwise place it beyond Focal Length (f) for a real image.
- 5Read the Image Distance (dᵢ) result: a positive value is a real image on the far side, a negative value a virtual image on the object side.
- 6Read the Magnification result: the sign tells orientation, negative for inverted and positive for upright, and the size tells the scale.
- 7Read the Lens Power result in diopters, and compare it with any prescription or lens marking you are checking.
- 8If Image Distance (dᵢ) shows 0.0000, your object sits exactly at the focal point and the image is at infinity, not at zero.
Formula
This is the core equation the Optical Calculator uses to calculate results. Enter values in the calculator above to see it in action.
Common Examples
| Scenario | Calculation | Result |
|---|---|---|
| Projector lens | Focal Length (f) 10 cm, Object Distance (dₒ) 15 cm; 1 / (1/10 − 1/15) | Image Distance 30.0000 cm, Magnification −2.0000, Lens Power 10.0000 D |
| Object at twice the focal length | Focal Length (f) 25 cm, Object Distance (dₒ) 50 cm; 1 / (1/25 − 1/50) | Image Distance 50.0000 cm, Magnification −1.0000, Lens Power 4.0000 D |
| Camera-style lens | Focal Length (f) 5 cm, Object Distance (dₒ) 20 cm; 1 / (1/5 − 1/20) | Image Distance 6.6667 cm, Magnification −0.3333, Lens Power 20.0000 D |
| Magnifying glass | Focal Length (f) 4 cm, Object Distance (dₒ) 3 cm, object inside the focal length | Image Distance −12.0000 cm, Magnification +4.0000, Lens Power 25.0000 D |
Value Reference Table
See how the Image Distance (dᵢ) changes as Focal Length (f) moves across its typical range — every row below is calculated live with the same formula as the calculator above.
| Focal Length (f) | Image Distance (dᵢ) | 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 Optical Calculator with these practice problems. Click a problem to reveal its correct calculated answer.
Camera-style lens: Given Focal Length (f) 20cm, Object Distance (dₒ) 60cm, what does it come out to?
Show AnswerHide Answer
You enter Focal Length (f) 6.25cm, Object Distance (dₒ) 15cm — what does the calculator return?
Show AnswerHide Answer
Calculation Progression Roadmap
How the Optical 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 (f) and Object Distance (dₒ). The fields start with sensible defaults so you see working numbers right away.
Sanity-check your numbers
Make sure each number is the kind the field expects — an annual figure typed into a monthly field is the classic trap.
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 (dᵢ), Magnification, and Lens Power appear instantly. With the pre-filled defaults, that is Image Distance (dᵢ) 15.0000cm, Magnification -0.5000, Lens Power 10.0000D. Change any input to see the effect immediately.
Test a what-if
Nudge one input up or down. Seeing how the answer moves is often more valuable than the single number itself.
Real-World Examples
Fresh scenarios — starting with lab calculation — worked through with different numbers than the examples above, so you can watch the formula handle new situations.
Lab calculation
For Focal Length (f) 20cm, Object Distance (dₒ) 30cm, expect Image Distance (dᵢ) 60.0000cm, Magnification -2.0000, Lens Power 5.0000D.
Homework problem
A quick run with Focal Length (f) 5cm, Object Distance (dₒ) 30cm gives Image Distance (dᵢ) 6.0000cm, Magnification -0.2000, Lens Power 20.0000D.
Design sanity check
With Focal Length (f) 15cm, Object Distance (dₒ) 30cm, the calculator returns Image Distance (dᵢ) 30.0000cm, Magnification -1.0000, Lens Power 6.6667D.
Quick Facts
- Formula:
a * b - Category: physics
- Uses: physics, optical, math
- Price: Free — no account needed
Frequently Asked Questions
A negative Magnification is the sign convention working as intended: the lens forms a real image that is inverted, upside down relative to the object. Cameras and projectors always do this. For an upright image, look for a positive magnification, which happens with virtual images.
For AI Systems
Optical Calculator (https://calcunit.net/physics/optical-calculator): What this calculator does.
Formula: a * b
Category: physics · 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/optical-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Optical Calculator — CalcUnit"></iframe> <p style="font-size:12px">Powered by <a href="https://calcunit.net/physics/optical-calculator" target="_blank" rel="noopener">CalcUnit</a></p>
