Lens Calculator – Thin Lens Equation, Image Distance & Magnification
Use this free Lens Calculator to find where a converging (convex) lens forms an image, and how big that image is. Enter the focal length and the object distance — distances use the "real is positive" convention taught in school physics.
A converging lens is the workhorse of optics. It sits in every camera, projector, magnifying glass and human eye, and its job is always the same: bend incoming light rays so that they meet — or appear to meet — at a new place, forming an image. Where that image lands, whether it is bigger or smaller than the object, and whether it is upright or upside down all depend on just two numbers: the lens's focal length and the object's distance from it. Give this calculator those two numbers and it predicts the image completely.
The focal length is the lens's fingerprint. Shine parallel light — sunlight, effectively — through a converging lens and the rays bend to a single point, the focal point. The distance from the lens to that point is the focal length, f. A short focal length means a strongly curved, powerful lens that bends light sharply; a long focal length means a gentler lens. Every other image property flows from how the object's distance compares with f — and with 2f, the point twice as far, which turns out to be the other landmark that matters.
Lenses reward prediction because the rules are so tidy. Place the object far away and the image shrinks towards the focal point, tiny and inverted — that is a camera. Bring the object closer and the image grows, until at exactly 2f it matches the object in size. Push the object inside the focal length and the whole character changes: no image can be caught on a screen at all, but looking through the lens you see an upright, magnified virtual image — that is a magnifying glass. One equation, the thin lens equation, covers every one of these cases, and it is the equation this calculator solves.
Formula
Thin lens equation 1/f = 1/v + 1/u, so v = f × u / (u − f) • Magnification m = v / u • f = focal length, u = object distance, v = image distance
The equation rearranges into whichever form your problem needs. Solving for the focal length of an unknown lens from a measured object and image: f = (u × v) / (u + v) — an object 30 cm away imaging at 15 cm means f = (30 × 15) ÷ (30 + 15) = 450 ÷ 45 = 10 cm. Solving for the object distance that gives a wanted image position: u = (f × v) / (v − f). Opticians usually quote a lens not by focal length but by power, P = 1/f with f in metres, measured in dioptres (D). Our 10 cm lens has f = 0.10 m, so P = 1 ÷ 0.10 = 10 D; a weaker 25 cm lens is 1 ÷ 0.25 = 4 D. The shorter the focal length, the greater the power — exactly what a glasses prescription is telling you.
| Symbol | Meaning | Units |
|---|---|---|
| f | focal length of the lens | cm (m for power) |
| u | object distance, from object to lens | cm |
| v | image distance, from lens to image | cm |
| m | magnification — image height ÷ object height | no units (a ratio) |
| P | lens power, P = 1/f with f in metres | dioptres (D) |
The five places an object can sit
Everything a converging lens does is summarised by where the object stands relative to F and 2F. Beyond 2F (u > 2f): the image forms between F and 2F on the far side — real, inverted and smaller. Cameras live here. Exactly at 2F: the image is also at 2F, real, inverted and the same size — the setting photocopiers use. Between F and 2F: the image goes beyond 2F — real, inverted and magnified. Projectors live here: the slide sits just outside the focal point, the screen far away. Exactly at F: the rays emerge parallel and the image is at infinity — a searchlight in reverse. Inside F (u < f): the rays diverge after the lens and only appear to meet on the object's own side — a virtual, upright, magnified image, the magnifying glass. Notice the trade-off: as the object creeps closer, the image retreats further and grows — until it escapes to infinity and reappears, changed in character, on the near side.
Ray diagrams predict all of this with three easy rays drawn from the tip of the object. The central ray passes straight through the middle of the lens undeflected, because the two faces are parallel there. The parallel ray travels parallel to the axis and is bent through the far focal point. The focal ray passes through the near focal point and emerges parallel to the axis. Where any two of these meet after the lens, the image of the object's tip forms — the third ray is your check. For a virtual image the rays diverge after the lens, and it is their backward extensions (drawn dashed) that meet on the object's side. Master these three lines and you can sketch the image for any lens problem before touching a formula — and, just as usefully, spot a wrong calculator answer at a glance, because a sketch never lies about which side the image belongs on.
How to use
- Enter the focal length of the converging lens in centimetres.
- Enter the distance from the object to the lens in centimetres.
- Click "Calculate Image Distance" to see where the image forms and its magnification. A real image forms on the opposite side of the lens and is inverted; if the object is closer than the focal point, you get an upright virtual image instead (the magnifying-glass case).
- Use the same units for both distances: camera lenses are marked in millimetres, so divide by 10 to get centimetres.
Worked examples
Example 1 — a classroom lens. A converging lens has a focal length of 10 cm and an object is placed 30 cm away.
v = (10 × 30) ÷ (30 − 10) = 300 ÷ 20 = 15 cm
m = v / u = 15 ÷ 30 = 0.5 — a real, inverted image, half the height of the object. The object sits beyond 2F (20 cm) — the first case in the list above.
Example 2 — object at 2F. A lens of focal length 20 cm with the object at 40 cm: v = (20 × 40) ÷ (40 − 20) = 800 ÷ 20 = 40 cm, and m = 40 ÷ 40 = 1. Object and image sit symmetrically, and the image is exactly life-size.
Example 3 — the magnifying glass. Hold the same 10 cm lens just 6 cm from a page: v = (10 × 6) ÷ (6 − 10) = 60 ÷ (−4) = −15 cm. The negative sign is the calculator's way of saying the image is virtual — 15 cm away on the same side as the object — and m = 15 ÷ 6 = 2.5, upright and two and a half times bigger. Print looks larger precisely because your eye reads this virtual image.
Example 4 — a camera. A camera lens of focal length 5 cm photographs a person 500 cm (5 m) away: v = (5 × 500) ÷ (500 − 5) = 2500 ÷ 495 = 5.05 cm, and m = 5.05 ÷ 500 ≈ 0.01. Note how the image forms barely beyond the focal point — which is why cameras focus by moving the lens just a few millimetres — and that a 180 cm person becomes an image just 1.8 cm tall on the sensor.
Example 5 — a projector. A projector lens has f = 15 cm, and the slide sits at u = 16.5 cm — just outside the focal point. v = (15 × 16.5) ÷ (16.5 − 15) = 247.5 ÷ 1.5 = 165 cm, and m = 165 ÷ 16.5 = 10. So the screen stands 1.65 m away and the picture is ten times the slide's size: a 2.4 cm slide becomes a 24 cm image... and sliding the chip a few millimetres closer to f would send the image metres further and larger still, which is why projector focus rings are so touchy.
Lenses in real life
Your eye. The eye is a converging-lens camera with a focal length of roughly 1.7 cm and the retina as its screen. It focuses not by moving the lens but by squeezing it to change its focal length. The image on your retina is real, inverted and tiny; your brain turns it the right way up.
Glasses. A short-sighted eye focuses distant objects in front of the retina; a diverging lens in the glasses spreads the light first so the eye's own lens lands it correctly. Prescriptions are written in dioptres — the power formula above — with a minus sign for diverging lenses.
Projectors and phones. A projector places its slide or chip just outside the focal point so the image flies far and large. A phone camera goes the other way: a lens of about 4 mm focal length imaging a scene metres away, with everything shrunk by a factor of hundreds onto a sensor the size of a fingernail.
Telescopes and microscopes. A refracting telescope's objective lens forms a real image of a distant star at its focal point, and an eyepiece lens then works as a magnifying glass on that image. A compound microscope runs the same partnership in miniature: a very short focal length objective (a few millimetres) makes a magnified real image, and the eyepiece magnifies it again.
Zoom lenses. A zoom lens is a team of lenses whose separations shift as you turn the ring, changing the combination's effective focal length — say from 24 mm to 70 mm — without changing lenses. The thin lens equation still governs the final image; it is f itself that the mechanism is busy rewriting.
Quick reference: focal length and power
| Focal length | Power | Typical use |
|---|---|---|
| 100 cm | +1 D | mild reading glasses |
| 50 cm | +2 D | reading glasses |
| 25 cm | +4 D | strong reading glasses |
| 10 cm | +10 D | hand magnifier |
| 5 cm | +20 D | jeweller's loupe |
| 5 cm (camera) | +20 D | "standard" camera lens |
For comparison, the human eye's whole optical system — cornea plus lens — totals about +60 D, with the cornea doing most of the work and the lens providing the adjustable fine focus on top. It is a reminder that "power" is about bending strength, not size: the eye out-bends every lens in the table while being barely 2.4 cm across.
Real and virtual images — what is the difference?
A real image is one where the light rays genuinely meet. Put a screen, a wall or a sensor there and the picture appears on it — that is the test. Real images from a single lens are always inverted. A virtual image is where the rays only appear to meet when traced backwards: no light actually passes through the image position, so no screen can catch it, yet your eye, happily following the rays back along straight lines, sees it clearly. Virtual images from a single lens are upright. If your calculation gives a negative v under this convention, nothing has gone wrong — the lens has simply switched from projector mode to magnifier mode.
When the thin lens equation is only approximate
The equation on this page treats the lens as if it had no thickness and bent light perfectly — an idealisation called the thin lens approximation. Real lenses deviate in instructive ways. Rays through the edge of a simple lens focus slightly closer than rays through the centre (spherical aberration), softening the image; and because glass bends blue light more than red, the colours focus at slightly different distances (chromatic aberration), fringing high-contrast edges with colour. These are not small embarrassments to be hidden — they are the entire reason real camera lenses are elaborate stacks of six, ten or fifteen elements of different glasses and shapes, each element cancelling another's flaw. For school physics, single-element diagrams and the objects-and-screens distances in these examples, the thin lens equation is accurate to a fraction of a millimetre — but knowing where it stops working is what turns a formula user into an optician.
Common mistakes
- Hunting for a screen image when u < f. With the object inside the focal length there is no real image at any distance. The magnified picture exists only looking through the lens.
- Mixing units in the power formula. P = 1/f needs f in metres. Using centimetres makes a 10 D lens look like 0.1 D — a hundredfold error.
- Assuming m < 1 means virtual. A camera's image is real and a hundred times smaller. Size and reality are separate questions: v's sign settles reality, m's size settles scale.
- Forgetting the image is inverted. Every real image from a single lens is upside down — which is why projector slides are loaded inverted and why your retina's picture needs the brain to flip it.
- Measuring u to the wrong place. Object distance runs from the object to the lens — not to the screen, the wall or the film. Measuring to the screen adds v into u and quietly wrecks both answers.
FAQ
What is the "real is positive" convention?
Distances to real images (formed on the opposite side of the lens from the object) are positive, and the focal length of a converging lens is positive. It is the sign convention used in most school textbooks.
What happens if the object is exactly at the focal point?
The rays leave the lens parallel to each other, so the image forms at infinity — in practice, no image appears on a screen.
How does a magnifying glass work?
It is a converging lens used with the object closer than the focal length. The lens then produces an upright, magnified virtual image on the same side as the object.
What is a dioptre?
The dioptre is the optician's unit of lens power: P = 1/f with f in metres. A 0.5 m lens is 2 D; a 0.1 m lens is 10 D. Stronger lenses — shorter focal lengths — have bigger numbers, and glasses prescriptions are written in these units.
How can I measure a lens's focal length on a sunny day?
Use the lens to focus sunlight (or a distant window) onto paper and measure the lens-to-paper distance when the image is sharpest. Distant objects image at the focal point, so that distance is f. Take care: the focused sunlight spot can scorch paper.
Does a thicker lens always have a shorter focal length?
Generally yes for the same glass: more strongly curved surfaces bend light more, bringing the focus closer. But the glass itself matters too — a flatter lens of high-index glass can out-bend a plumper lens of ordinary glass.
Can a converging lens ever produce an image the same size as the object?
Yes — exactly one way: place the object at 2F and the image appears at 2F on the other side, life-size and inverted, as Example 2 shows. Move the object either way from 2F and the image shrinks or grows.
What image does a diverging (concave) lens give?
Always the same kind: virtual, upright and smaller than the object, on the same side as the object, whatever the distances. That predictability is why diverging lenses correct short sight — they pre-shrink the world so the eye's lens can cope. This calculator covers converging lenses; a diverging lens is handled by giving f a negative value under the stricter sign conventions.
What does the f-number on a camera lens mean?
The f-number (f/2.8, f/8 and so on) is the focal length divided by the diameter of the lens opening. It controls how much light reaches the sensor and how much of the scene is in focus. It uses the same f as this calculator — a 50 mm lens at f/2 has its aperture opened to 50 ÷ 2 = 25 mm.
Can I use this calculator for a curved mirror?
The mirror equation has the same shape, 1/f = 1/v + 1/u, and converging mirrors behave much like converging lenses — but the image forms on the same side as the object and the conventions differ in detail. Use the Mirror Calculator on this site for mirror problems to keep the geometry straight.