Thin Lens Equation Image Distance, Diopters & Magnification Calculator

Solve the Gaussian thin-lens equation for real/virtual image distance and magnification.

Image Distance (d_i) 62.5 mm
Lateral Magnification (M) -0.25 ×
Image Height (Negative = Inverted) -6 mm
Optical Power (Focal Length in mm) 20 D
Inputs
Try:
mm
Lens focal length (f) in millimeters (+ converging, − diverging).
mm
Object distance from optical center (d_o) in millimeters.
mm
Physical object height in millimeters.
Results & Graph
Image Distance (d_i)
62.5 mm
Lateral Magnification (M)
-0.25 ×
Image Height (Negative = Inverted)
-6 mm
Optical Power (Focal Length in mm)
20 D

Image Distance (d_i)

Graph 1 • How the inputs feed Thin Lens & Magnification
Thin Lens Equation Image Distance, Diopters & Magnification Calculator • Custom Domain Schematic (Optics, Photonics & Acoustics) focalLen → objectDiPhysical Response & Transfer Law (Thin Lens & Magnificat) Focal Length Mm: 50 mm • Object Distance Mm: 250 mm IMAGE DISTANCE (D_I) 62.5 mm • Lateral Magnification : -0.25 × • Image Height (Negative: -6 mm Eq: 1 / f = 1 / d_o + 1 / d_i ⇒
Graph 2 • Image Distance (d_i) as Focal Length Mm changes (40% to 160% of current)
0 mm 64.71 mm 129.4 mm 21.74 20mm 34.09 30mm 47.62 40mm 62.50 50mm 78.95 60mm 97.22 70mm 117.7 80mm
Graph 3 • Focal Length Mm and Object Distance Mm together Compares Image Distance (d_i) when Object Distance Mm is shifted +25% (solid) vs. −25% (dashed).
0 mm 54.72 mm 109.4 mm --- Object Distance Mm @ 75% 39.41 -30% 49.19 -15% 59.52 +0% 70.47 +15% 82.07 +30%
Summary: With f=50 mm and object at 250 mm, image forms at d_i = 62.5 mm (Real image) with magnification -0.25×.
Summary: With f=50 mm and object at 250 mm, image forms at d_i = 62.5 mm (Real image) with magnification -0.25×.
Interactive chart & math engine powered by CalculatorGraph

Formula: Thin Lens & Magnification Physics & Engineering Equation

1 / f = 1 / do + 1 / di ⇒ di = f × dodo − f
M = −di / do
1 / f = 1 / d_o + 1 / d_i ⇒ d_i = (f × d_o) / (d_o − f); M = −d_i / d_o
  • focalLengthMm: Focal Length (mm)
  • objectDistanceMm: Object Distance (mm)
  • objectHeightMm: Object Height (mm)

Rounding: Physical constants follow CODATA/NIST values; output quantities display to 2 decimal places.

Frequently Asked Questions

How do I know if my image is real or virtual from the output?

Look at the sign of the image distance. A positive value means a real image on the far side of the lens that you could catch on a screen. A negative value means a virtual image on the object's side. The summary sentence also says Real image or Virtual image, so you can read it there as well.

Why is the magnification negative when the image looks fine on my camera screen?

The optical image on the sensor really is upside down and reversed. A magnification of -0.25 for the default setup means a quarter-size, inverted image. The camera's software flips it before showing it to you, and film cameras put prisms or mirrors in the viewfinder for the same reason. The sign describes the optics, not the picture you see.

How close can I put an object to a 50 mm lens and still get a real image?

Any distance greater than 50 mm gives a real image, but the image moves far away as the object nears the focal point. At 75 mm the image is about twice the object distance away and twice the size. At 55 mm it would be several times further still. Below 50 mm the image becomes virtual.

Does the object height change where the image forms?

No. Object height only scales the image height line; image distance and magnification do not depend on it. Doubling the default 24 mm object to 48 mm doubles the image from -6 mm to -12 mm and leaves the 62.5 mm image distance alone. Use whatever unit you like for height, as long as you read the result in the same unit. Height matters only when you need to know whether the image will fit on a sensor or screen.

Can I enter distances in centimetres instead of millimetres?

The distance results scale correctly if focal length and object distance use the same unit, because the equation is unit-free. The diopter line, though, assumes millimetres, since it divides one thousand by the focal length. Enter centimetres and the power will be ten times too small. Stick to millimetres if you need diopters.

How do I work out a two-lens system with this tool?

Run the first lens on its own and note the image distance. Subtract that from the spacing between the lenses to get the object distance for the second lens, then run the second lens. Multiply the two magnifications for the overall magnification. If the first image lands beyond the second lens, it becomes a virtual object, which the tool cannot accept. In that case solve the second lens by hand with a negative object distance.

Why does a magnifying glass need the object inside the focal length?

Inside the focal length the lens cannot bring rays to a focus, so they emerge still diverging and your eye sees an enlarged, upright virtual image. With the default 50 mm lens and an object at 30 mm, the tool shows a magnification of 2.5. Outside the focal length you would get a real, inverted image instead.

What object distance gives a same-size image?

For a converging lens, put the object at twice the focal length. The image then forms at twice the focal length on the other side, with a magnification of -1. For the default 50 mm lens that means 100 mm on each side, a total object-to-image distance of four focal lengths, which is the shortest possible for a real image.

Is the Image Height line signed?

Yes. It multiplies the object height by the signed magnification, so a negative value means the image is inverted. With a 24 mm object and a magnification of -0.25 it reports -6 mm, and with a magnification of 2.5 it reports a positive 60 mm, an upright virtual image. The magnification line carries the same sign, so the two always agree.

Does the lens material or shape matter here?

Not directly. The tool takes the focal length as given, and the glass type, curvature and thickness are all folded into that one number. If you need to find the focal length from the surface radii and refractive index, use the lensmaker's equation first and then bring the focal length here. Remember that focal length also shifts slightly with wavelength, so a value quoted for one colour of light may not match another.

A 50 mm lens with the object at 250 mm

The default setup is a converging lens with a focal length of 50 mm, an object 250 mm in front of it, and an object 24 mm tall. The tool places the image 62.5 mm behind the lens, with a lateral magnification of -0.25, an image height of -6 mm, and an optical power of 20 diopters.

Checking it by hand takes one subtraction. The thin lens equation says 1/f equals 1/do plus 1/di, so 1/di equals 1/50 minus 1/250, and putting both over a common base gives 5/250 minus 1/250, or 4/250, and flipping it shows that di is 62.5 mm.

The rearranged form the tool uses, di equals f times do divided by (do minus f), gives the same thing: 50 times 250, divided by 250 minus 50. Magnification is minus di over do, so -62.5 over 250, which is -0.25. The image is a quarter the size of the object and the minus sign says it is upside down.

The first result line, Image Distance, is how far behind the lens the sharp image forms. Do not confuse it with the focal length, the 50 mm you typed in. The image distance only approaches the focal length when the object is very far away; at 250 mm it is already 12.5 mm further back.

Sign conventions behind the minus signs

The tool follows the common real-is-positive convention. A positive image distance means a real image on the far side of the lens, where light actually converges and you could put a screen or a sensor. A negative image distance means a virtual image on the same side as the object, which you can see by looking through the lens but cannot project.

Focal length is positive for a converging lens and negative for a diverging one, as the input label says. Object distance should be positive for an ordinary real object in front of the lens.

Magnification carries orientation. Negative means inverted, positive means upright. Its size gives the scale: 0.25 means a quarter size, 2.5 means two and a half times larger.

The Image Height line keeps that sign too, and its label says so: negative means inverted. For the default it reads -6 mm, a 6 mm image upside down. In the magnifier case below it reads a positive 60 mm, an upright image. Some optics courses use the opposite Cartesian convention, where distances to the left of the lens are negative; if yours does, your signs on do will differ but the physical answer is the same.

Inside the focal length: a virtual, magnified image

Move the object to 30 mm, closer to the lens than its 50 mm focal length. The tool now gives an image distance of -75 mm, a magnification of 2.5 and an image height of 60 mm, and the summary sentence says Virtual image.

By hand: 1/di equals 1/50 minus 1/30. That is 0.02 minus 0.0333, or minus 0.0133, and 1 divided by 0.0133 is 75. So di is -75 mm. Magnification is minus (-75) over 30, which is plus 2.5.

This is a magnifying glass. The lens cannot bring the rays to a focus, so they leave the lens still spreading, and your eye traces them back to an upright, enlarged image 75 mm behind the object on the same side. The closer the object gets to the focal point from inside, the larger and further away that virtual image becomes.

Move the object closer still and the magnification falls back toward 1. At 10 mm it is about 1.25. A hand lens works best with the object just inside the focal length, not pressed against the glass.

The points where image and object swap roles

Two object positions are worth knowing for a converging lens. At twice the focal length, 100 mm for the default lens, the image also forms at 100 mm and the magnification is exactly -1: same size, inverted. Entering 100 for the object distance confirms it.

Between f and 2f the image is real, inverted and larger than the object. At 75 mm the tool gives a magnification of -2 and an image height of -48 mm. This is the projector arrangement: a small slide just beyond the focal point throws a large image a long way off.

Beyond 2f the image is real, inverted and smaller, which is the camera arrangement. The default 250 mm object sits here, five times the focal length, with a quarter-size image.

At exactly the focal length the rays leave the lens parallel and no image forms at any finite distance. The tool recognises this case: with the object at 50 mm it returns an error explaining that the image is at infinity, rather than a number. Move the object even slightly either way and you get a real answer, but a very large one, because the image runs off toward infinity as the object approaches f.

Diverging lenses always give smaller, upright images

Enter -50 for the focal length and keep the object at 250 mm. The image distance comes out at -41.67 mm, the magnification at 0.17 (more precisely 0.1667), the image height at 4 mm and the power at -20 diopters.

By hand: 1/di equals -1/50 minus 1/250, which is -5/250 minus 1/250, or -6/250, which gives di of -41.67 mm. The magnification is 41.67 over 250, about one sixth.

Move the object in to 30 mm and the image is at -18.75 mm with a magnification of 0.63 (0.625 before rounding). However you place a real object, a single diverging lens gives a virtual, upright image that is smaller than the object and sits between the lens and its focal point.

That is why a diverging lens on its own cannot project anything. It is used to spread a beam, to correct short sight, or in combination with a converging lens to change the overall focal length of a system.

Comparing the 30 mm, 50 mm and 75 mm presets

Here the object stays at 250 mm and only the lens changes. A 30 mm lens forms the image at 34.09 mm with magnification -0.14 and an image 3.27 mm tall. The default 50 mm lens gives 62.5 mm and -0.25. A 75 mm lens gives 107.14 mm and -0.43, with an image 10.29 mm tall.

Longer focal length means a larger image of the same object, which is why telephoto lenses fill the frame. It also means the image forms further from the lens. The 75 mm lens needs its sensor 107.14 mm back, where the same lens focused far away would need only 75 mm.

That extra distance is focusing extension. For the default 50 mm lens, focusing on something at 250 mm instead of at infinity needs 12.5 mm of extra travel, the difference between 62.5 and 50. Close focus on real lenses is limited by how far the optics can move.

The powers drop as focal length grows: 33.33 D for the 30 mm lens, 20 D for 50 mm and 13.33 D for 75 mm.

What diopters mean and why the tool shows them

Optical power in diopters is 1 divided by the focal length in metres. A 50 mm lens has a focal length of 0.05 m, so its power is 1 over 0.05, which is 20 D. A diverging lens has negative power.

Opticians use diopters because the powers of thin lenses placed in contact add up. A +20 D lens pressed against a -5 D lens behaves roughly like a single +15 D lens, with a focal length of about 66.7 mm. Adding focal lengths directly would give nonsense.

To go the other way, from a spectacle prescription to the focal length box, divide 1 by the diopter value to get metres, then convert to millimetres. A prescription of +2.00 D is a half-metre lens, and -4.00 D is a diverging lens with a focal length of a quarter metre, so enter -250 mm. The real effect of glasses also depends on the distance from the lens to the eye, which this tool does not include.

A focal length of 0 is not a real lens, and the tool rejects it with an error. The power line is labelled to remind you that it expects the focal length in millimetres: it divides one thousand by the millimetre value, which is the same as 1 over the focal length in metres.

Where the thin lens model breaks down

The equation assumes a lens thin enough that its thickness can be ignored, light rays close to the axis, and the same medium, usually air, on both sides. Under those conditions it is very accurate for simple spectacle lenses, magnifiers and long focal length singlets.

Real camera lenses are thick, multi-element systems. For those, measure do and di from the front and rear principal planes rather than from the glass. The equation still holds between those planes, but the planes can sit well inside or even outside the lens barrel, so a tape measure from the front element will not match.

It also ignores aberrations. Spherical aberration, field curvature and chromatic aberration all blur the image away from the ideal point. The tool gives you where the paraxial image is, not how sharp it will be.

Object distance must be greater than zero, and a zero or negative entry produces an error. In a multi-lens system a negative object distance can stand for a virtual object, formed behind the lens by an earlier element. The tool does not handle that case, so if you are chaining lenses, work the second lens by hand when its object lies behind it.