Thin Lens Calculator1/f = 1/do + 1/di
The thin lens equation links focal length, object distance and image distance: 1/f = 1/do + 1/di. Magnification is m = −di ÷ do. Enter the focal length and object distance to find where the image forms, how big it is, and whether it is real or virtual and upright or inverted. You can also solve for the focal length or convert to lens power in dioptres. A scaled ray diagram traces the principal rays.
Formula verified against OpenStax — University Physics, Volume 3 · HyperPhysics, Georgia State University
Reviewed & updated
Lens & object
Converging (convex) lens: f > 0. Diverging (concave) lens: f < 0.
Step-by-step working
What is thin lens?
A thin lens is a lens whose thickness is small compared with its focal length, so it can be treated as bending light at a single plane. The thin lens equation then predicts exactly where images form.
The same equation describes camera lenses, eyeglasses, magnifiers, projectors and the lens in your eye, which changes its focal length to keep the image distance fixed on your retina.
Quick answers
How do I find the image distance of a lens?
Use di = 1 ÷ (1/f − 1/do). With f = 20 cm and an object at 60 cm, the image forms at 30 cm on the far side.
How do you calculate magnification?
m = −di ÷ do. A negative m means the image is inverted; |m| > 1 means it is enlarged.
How do I convert focal length to dioptres?
Power (D) = 1 ÷ f in metres. A +2.5 D reading lens has f = 40 cm; a −4 D myopia lens has f = −25 cm.
Why is a magnifying glass image upright?
With the object inside the focal length, the rays diverge after the lens and only appear to come from a virtual, upright, enlarged image. It all starts with refraction at each curved surface.
Thin lens equation
Sign convention: real images have di > 0, virtual images di < 0. Negative m means the image is inverted.
| Symbol | Meaning | SI unit |
|---|---|---|
| f | Focal length (+ converging, − diverging) | m |
| do | Object distance from the lens | m |
| di | Image distance from the lens | m |
| m | Magnification | — |
| P | Optical power | dioptres (m⁻¹) |
How to use the thin lens equation
- Write 1/f = 1/do + 1/di with consistent units.
- Rearrange: 1/di = 1/f − 1/do.
- Invert to get di, and note its sign.
- Find the magnification m = −di ÷ do to get the image size and orientation.
Worked example: f = 10 cm, object at 30 cm
An object stands 30 cm from a converging lens with a 10 cm focal length.
m = −15 ÷ 30 = −0.5: real, inverted, half size
Move the object to 5 cm, inside the focal length, and di = 1 ÷ (1/10 − 1/5) = −10 cm. That is a virtual, upright image magnified 2×, how a magnifying glass works.
Image types for a converging lens
| Object position | Image | Example |
|---|---|---|
| Beyond 2f | Real, inverted, smaller, between f and 2f | Camera, eye |
| At 2f | Real, inverted, same size, at 2f | Photocopier 1:1 |
| Between f and 2f | Real, inverted, larger, beyond 2f | Projector |
| At f | No image (rays parallel) | Spotlight, collimator |
| Inside f | Virtual, upright, larger | Magnifying glass |
Common mistakes to avoid
- Mixing up the signs. Diverging lenses have negative f, and virtual images negative di.
- Mixing units. Use the same unit for f and both distances. Dioptres need metres.
- Using the thin-lens formula for thick or compound lenses without principal-plane corrections.
Related physics calculators
Optics tools to pair with the lens equation:

Manzoor Ahmad
Pharmacist turned Web Developer & Calculator Engineer · 13+ years in web developmentI’m a pharmacist by training who turned into a full-time tech geek, and for 13+ years I’ve designed and coded web tools. My pharmacy degree included physical pharmacy and pharmaceutics — states of matter, heat, flow and reaction kinetics — so the physics behind these tools is familiar ground, not a new hobby.
I’m not a physicist, so I don’t ask you to take my word for it: every formula on this page is traced to an open university textbook or NIST reference data, and the calculator is tested against published worked examples before it goes live. Spot an error? Tell me and it will be fixed and dated on the next update.
Thin Lens Calculator: frequently asked questions
1/f = 1/do + 1/di, relating focal length to object and image distances.
The image is virtual and sits on the same side of the lens as the object.
m = −di ÷ do = hi ÷ ho.
The unit of optical power, 1 ÷ focal length in metres. Eyeglass prescriptions are written in dioptres.
When the lens thickness is small compared with its focal length and the object and image distances.
References & sources
- OpenStax — University Physics, Volume 3 — Ch. 2.4, Thin Lenses
- HyperPhysics, Georgia State University — thin lens equation
- OpenStax — College Physics 2e — Ch. 25.6, Image Formation by Lenses
Disclaimer: This calculator is an educational tool built on idealised textbook models. It is not a substitute for professional engineering or safety calculations.
