MotionLab
Lens Equation Calculator
Where a lens actually forms an image — the formula behind cameras, telescopes, and eyeglasses.
Image distance from focal length and object distance
The thin lens equation: 1/f = 1/do + 1/di. Positive focal lengths are converging lenses, negative are diverging.
| Focal length (cm) | Object distance (cm) | Image distance (cm) | Image |
|---|---|---|---|
| 10 | 30 | 15.000 | Real, inverted, smaller |
| 10 | 20 | 20.000 | Real, inverted, same size |
| 10 | 15 | 30.000 | Real, inverted, larger |
| 50 | 200 | 66.667 | Real, inverted, smaller |
| -10 | 20 | -6.667 | Virtual, upright, smaller |
The second row sits at exactly twice the focal length on both sides, which is the only arrangement giving a same-size real image - the basis of 1:1 macro photography. Move the object closer than 2f and the image grows and moves further out, as row three shows. The last row is a diverging lens: the negative image distance means a virtual image on the same side as the object, which cannot be projected onto a screen. Bring an object inside the focal length of a converging lens and you get the same effect, which is how a magnifying glass works.
Sign conventions matter in real optics
This calculator uses a simplified version — real optics problems track positive/negative signs carefully to distinguish real images (light actually converges there) from virtual images (light only appears to come from there, like in a magnifying glass held close to an object).
Why objects closer than the focal length behave differently
When an object is placed closer to the lens than its focal length, the thin lens equation produces a negative image distance — physically, this means the lens can't form a real image and instead produces a virtual, magnified one, as with a magnifying glass.
Frequently asked questions
A camera lens has f = 50 mm and I'm photographing something 2 m away. Where does the image form?
1/d_i = 1/f − 1/d_o = 1/0.05 − 1/2 = 20 − 0.5 = 19.5. d_i = 0.0513 m = 51.3 mm. The image forms just past the focal point — which is why the sensor sits right behind the lens.
What happens when I focus a magnifying glass on a distant object?
Distant objects (d_o → ∞) form images at the focal point: 1/d_i = 1/f − 0 = 1/f. That's why you can start a fire by focusing sunlight — all the energy converges at f. For a 10 cm lens, the bright spot forms 10 cm behind the lens.
Why can't a single lens focus perfectly?
Real lenses suffer from aberrations: chromatic (different wavelengths focus at different distances), spherical (edge rays focus differently than center rays), and others. Camera lenses use multiple elements (6-18 lenses) to correct these — this calculator handles the ideal thin lens case.
How is the lens equation related to Snell's law?
The lens equation is derived FROM Snell's law. A lens is just a curved surface that refracts light — Snell's law at each point on the curve determines the bending, and the thin lens equation is the simplified result. See the Snell's law calculator for single-interface refraction.
What does negative image distance mean?
A negative d_i means the image is virtual — it forms on the same side as the object (behind the lens). This happens when the object is closer than the focal length, as with a magnifying glass. The image appears enlarged and upright, but you can't project it onto a screen.
Related Math calculators
Terminal Velocity Calculator
Maximum falling speed once drag force balances gravity.
OpenDrag Force Calculator
Air resistance force on a moving object.
OpenLift Force Calculator
Aerodynamic lift force on a wing or airfoil.
OpenHooke's Law Calculator
Restoring force from a spring's stiffness and displacement.
OpenLast updated: September 6, 2026