Skip to content

Lens Equation Calculator

What do you want to solve for?

Load a real optical setup

The Lens

Lens type

Enter the magnitude; the type sets the sign. Diverging lenses are negative.

cm

How far the object sits in front of the lens.

cm

Sets the image height and the size of the arrows in the ray diagram.

Image Distance (dᵢ)

15 cm

Type

Real

Orientation

Inverted

Size

Reduced

Magnification (m)

-0.5×

Image height (hᵢ)

-3 cm

FFobjectimage

Blue = ray parallel to the axis (bends through F). Green = ray through the lens center (undeviated). They cross on the far side — a real image.

The Equation, Filled In

1/f = 1/dₒ + 1/dᵢ  →  1/(10) = 1/(30) + 1/(15)

Magnification m = −dᵢ/dₒ = −(15)/(30) = -0.5

A real, inverted image forms 15 cm behind the lens, 0.5× the size of the object.

How to Use This Calculator

  1. 1.Pick what you're solving for — image distance is the usual homework question, but you can also back out the object distance or the focal length
  2. 2.Choose converging or divergingand enter the focal length's magnitude — the calculator handles the minus sign for a diverging lens
  3. 3.Enter the remaining distance. When you type an image distance, use a negative value for a virtual image on the same side as the object
  4. 4.Add an object height to get the image height, then read the type, orientation, and size badges and watch the ray diagram redraw
  5. 5.Tap a preset like "Slide projector" or "Magnifying glass" to load real optics instantly

Rate this calculator

Lens Equation Calculator: How to Find Image Distance and Magnification

Hold a magnifying glass with a 10 cm focal length about 6 cm above a coin and the coin looks bigger and right-side up. Slide the same glass out to 30 cm and the coin flips upside down and shrinks. Same lens, opposite behavior — and one relationship predicts both. This lens equation calculatorsolves 1/f = 1/dₒ + 1/dᵢ for whichever distance you're missing, then tells you whether the image is real or virtual, upright or inverted, and how much bigger or smaller it turns out. If you've ever wondered exactly how to calculate the distance of an image through a lens, the whole method fits on one line.

Lens equation ray diagram: object, converging lens, focal points, and the inverted real image formed by two principal rays

Solving a Magnifying-Glass Problem Before Touching the Formula

Take that second case — the coin 30 cm from a 10 cm converging lens — and work it through the way you would on an exam. You know two things: f = 10 cm and dₒ = 30 cm. You want the image distance, dᵢ. Rearrange the lens equation to 1/dᵢ = 1/f − 1/dₒ, then plug in: 1/dᵢ = 1/10 − 1/30 = 0.1 − 0.0333 = 0.0667 cm⁻¹. Flip that reciprocal and dᵢ = 15 cm. The magnification is m = −dᵢ/dₒ = −15/30 = −0.5, so the image is inverted and half the coin's size, sitting 15 cm behind the lens. That negative sign is the flip you saw.

Now the magnifier case, dₒ = 6 cm: 1/dᵢ = 1/10 − 1/6 = 0.1 − 0.1667 = −0.0667 cm⁻¹, so dᵢ = −15 cm and m = −(−15)/6 = +2.5. The negative image distance says the image is virtual — on the same side as the coin — and the positive magnification says it's upright and 2.5× larger. One equation, two setups, and the signs did all the storytelling. The calculator above runs these exact numbers when you load the "Magnifying glass" preset.

Why the Lens Equation Adds Reciprocals, Not Distances

The single most common wreck on these problems is treating 1/f = 1/dₒ + 1/dᵢ as if it said f = dₒ + dᵢ. It doesn't. You add the reciprocalsof the distances, and the answer you get is a reciprocal too, so the final step is always to flip it back. Skip that flip and a 15 cm image distance comes out looking like 0.0667. The reason it's reciprocals is that lens power scales with curvature, not length — a lens that bends light twice as strongly has half the focal length, so the natural quantity to add is 1/f, the power in diopters. That same "combine as reciprocals" pattern shows up when you wire resistors in parallel, where 1/R = 1/R₁ + 1/R₂. If parallel resistance already feels intuitive, the lens equation is the same algebra wearing an optics costume.

The Sign Convention That Separates Real Images From Virtual

Every wrong answer in optics can be traced back to a sign. Here is the convention this calculator uses — the standard one in intro physics, sometimes called "real is positive":

  • Focal length f: positive for a converging (convex) lens, negative for a diverging (concave) lens.
  • Object distance dₒ: positive for a real object in front of the lens — the everyday case.
  • Image distance dᵢ: positive when the image lands on the far side of the lens (real, projectable) and negative when it forms on the near side (virtual).

Get those three straight and the equation never lies to you. A converging lens with the object beyond its focal length always returns a positive dᵢ — a real image you could catch on a screen. Push the object inside the focal length and dᵢ goes negative, signaling the virtual, magnified image of a magnifying glass. A diverging lens returns a negative dᵢ for any object distance, which is why it can never project a picture.

What a Magnification of −0.5 Actually Tells You

Magnification packs two facts into one number: m = −dᵢ/dₒ, which also equals the height ratio hᵢ/hₒ. The size is just the absolute value — |m| = 0.5 means half height, |m| = 3 means triple. The sign carries orientation. A negative m is an inverted image, the hallmark of a real image from a single lens; a positive m is upright. So m = −0.5 is a real image, flipped, at half size — exactly what a camera does to a distant subject. Compare that to m = +0.5, which would be an upright, shrunken virtual image, the view through a diverging peephole lens. Same 0.5, completely different picture, and the minus sign is the only thing distinguishing them.

Real and Virtual Images, Side by Side

Students mix up real and virtual images more than any other pair in optics. Lining up their properties makes the difference concrete:

PropertyReal imageVirtual image
Image distance dᵢPositive (+)Negative (−)
Which side of the lensOpposite the objectSame side as the object
OrientationInverted (m < 0)Upright (m > 0)
Catch it on a screen?Yes — light actually converges thereNo — only the rays' back-extensions meet
When it happensConverging lens, object beyond fDiverging lens (always); converging lens, object inside f
Everyday exampleCamera sensor, film projector, your retinaMagnifying glass, door peephole, glasses for myopia

A Projector's Trick: The Slide Sits Just Past the Focal Point

Here's a setup that looks strange until the equation explains it. A slide projector with a 10 cm lens has to throw a 3.5 cm slide across a room as a picture nearly a meter wide. How? Put the slide at dₒ = 10.5 cm — a hair beyond the focal length. Then 1/dᵢ = 1/10 − 1/10.5 = 0.1 − 0.09524 = 0.00476, so dᵢ = 210 cm and m = −210/10.5 = −20. The slide's 3.5 cm becomes a 70 cm image, inverted — which is exactly why slides are loaded upside down.

Now nudge the slide just 0.3 cm closer, to dₒ = 10.2 cm: dᵢ jumps to about 510 cm and the magnification balloons to −50. That hair-trigger sensitivity near the focal point is why focusing a projector feels so touchy, and it's the physics behind macro photography too — shooting anything close to f demands a lens that can move by tiny, precise amounts. The closer the object creeps toward the focal length, the more violently the image distance swings.

Focal Lengths of the Lenses Around You

The thin lens equation isn't just a homework tool — it's the design rule behind the optics you use daily. Opticians talk in diopters, where power P = 1/f with f in meters, so a +2.00 D reading lens has a focal length of exactly 0.5 m. Here are representative values:

LensTypical focal lengthWhat it's doing
Smartphone camera~4–7 mmShort f for a tiny sensor and deep focus
Human eye (relaxed)~17 mm (about +59 D total)Focuses a real, inverted image on the retina
"Nifty fifty" camera lens50 mmNatural perspective on a full-frame sensor
Handheld magnifier75–250 mm (+4 to +13 D)Virtual, upright, enlarged image
+2.00 D reading glasses500 mmAdds converging power for close-up sight
Telescope objective400–2000 mmLong f for a large, bright image of far objects

These are geometric-optics numbers, and they ignore what happens at the smallest scales. No lens can focus light to a point tighter than roughly its wavelength — the diffraction limit — which is set by the wavelength of the wave doing the imaging. It's also worth remembering that the light being bent is a stream of individual photons, each carrying energy E = hf, whether the lens is a camera element or the front of your eye.

Where the Thin-Lens Equation Breaks Down

"Thin" is doing quiet work in "thin lens equation." The formula assumes the lens is thin enough that you can ignore its physical width and measure every distance from a single plane. It also assumes paraxial rays — light staying close to the axis at shallow angles — so both approximations start to fail in predictable ways:

  • Thick or compound lenses:a real camera lens is a stack of six to fifteen elements. You can't use one focal plane; opticians switch to the lensmaker's equation and ray-transfer (matrix) methods.
  • Wide apertures and steep angles: rays far from the axis focus at a slightly different point (spherical aberration), softening the image the equation says should be sharp.
  • White light: the focal length depends faintly on color, so red and blue focus at different spots (chromatic aberration) — invisible to the thin-lens formula, obvious in a cheap lens.

For a single simple lens and rays near the axis, though, 1/f = 1/dₒ + 1/dᵢ is accurate to a fraction of a percent. Treat it as an excellent first answer, and reach for heavier machinery only when the lens is thick, the aperture is wide, or color fringing matters.

The Sign Slip That Turns a Real Image Virtual

The error I see most often isn't the algebra — it's forgetting that a diverging lens has a negative focal length. A student enters f = +20 cm for a concave lens, computes a tidy positive image distance, and confidently reports a real image that physically cannot exist. A diverging lens produces only virtual, upright, reduced images, every time. Feed the correct f = −20 cm and the sign flips to reveal the virtual image. The habit that saves you: decide the lens type first, write the focal length with its sign before anything else, and let the equation carry that sign all the way through. For a full derivation and a gallery of ray diagrams, HyperPhysics keeps a clear thin-lens reference. Nail the sign convention and every "where does the image form?" problem becomes a plug-and-flip.

Marko Šinko
Marko ŠinkoCo-Founder & Lead Developer

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, Marko ensures precise physics computations and reliable calculator tools across AI Physics Calculator.

Last updated: July 3, 2026LinkedIn

Frequently Asked Questions

Related Calculators