Lens & Mirror Equation Calculator

Agarapu Ramesh — Editor and content reviewer

Enter any two of f, u, v and get the third — with magnification, image type and a diagram.

Formula

1/f = 1/u + 1/v
m = −v/u = hi/ho

Physics behind the lens/mirror equation

The thin-lens equation relates object distance u, image distance v and focal length f for an ideal (paraxial, thin) lens or mirror. A real image forms on the opposite side of the lens and can be projected on a screen; a virtual image forms on the same side as the object and cannot be projected. The sign of v tells you which is which: positive v = real image, negative v = virtual image. Magnification m relates image and object heights.

Worked example

Converging lens, f = 10 cm, u = 30 cm

1/v = 1/10 − 1/30 = 2/30
v = 15 cm  (real, inverted)
m = −v/u = −0.5  (diminished, inverted)
h_i = m·h_o = −1 cm

Related tools

Snell's Law Wave Speed Doppler Effect

FAQs

How do I use lens equation image distance calculator?

The thin-lens equation is 1/f = 1/d_o + 1/d_i, where f is focal length, d_o is object distance, d_i is image distance. Rearranging gives d_i = (f × d_o)/(d_o − f). For a converging lens with f = 10 cm and an object 30 cm away, d_i = (10 × 30)/(30 − 10) = 15 cm — a real image on the other side. Keep your sign convention consistent: distances on the same side as the incoming light are typically negative. The calculator handles arithmetic; you handle signs.

How do I use mirror equation formula calculator?

The mirror equation looks identical to the thin-lens version: 1/f = 1/d_o + 1/d_i. For concave mirrors, focal length is positive; for convex mirrors, it's negative. Plug in object distance and focal length, and the tool returns image distance, plus magnification m = −d_i/d_o. A concave mirror with f = 20 cm and an object 30 cm in front gives d_i = (20 × 30)/(30 − 20) = 60 cm, with m = −2 (inverted, double size). Sign conventions vary by textbook, so check which one your calculator uses before trusting the output.

How to find focal length from object and image distance?

Solve 1/f = 1/d_o + 1/d_i for f, which gives f = (d_o × d_i)/(d_o + d_i). If an object is 40 cm from a lens and the sharp image forms at 24 cm, then f = (40 × 24)/(40 + 24) = 960/64 = 15 cm. This is exactly how you measure the focal length of an unknown lens in a lab: project a sharp image, measure both distances, plug in. The harmonic-mean shape of the formula tells you f is always smaller than either distance — useful for sanity-checking your arithmetic.

What does negative image distance mean?

A negative image distance, in the standard sign convention, signals a virtual image — one that appears to be on the same side as the object, where light only seems to come from. You can't catch it on a screen because the rays don't actually converge there; your eye or another lens has to interpret them. A diverging lens always produces a virtual image with d_i < 0. A converging lens does the same when the object is closer than the focal point, which is exactly how a magnifying glass works. The negative sign is geometry, not arithmetic error.

How do I use lens magnification calculator object image distance?

Magnification is m = −d_i/d_o. The negative sign accounts for image inversion. So an object 30 cm from a lens producing an image 60 cm away has m = −60/30 = −2: image is twice as tall and inverted. If the result is positive, the image is upright; negative, inverted. If |m| > 1, image is enlarged; if |m| < 1, reduced. The calculator returns this from the same inputs that gave you the image distance. Together, lens equation and magnification let you predict both where and how big an image will be.

What does negative magnification mean?

Negative magnification means the image is inverted relative to the object — flipped upside-down. This always happens for real images formed by single converging lenses or concave mirrors. So a slide projector creates a negative magnification: the slide goes in upright, but the image on the screen is inverted, which is why slides are loaded upside-down. Positive magnification means the image is upright, which happens with virtual images from magnifying glasses or convex mirrors. The size factor is the magnitude of m; the sign tells you orientation. Both pieces of information matter when describing what an optical system does.

How do I use real vs virtual image calculator lens?

Real images form where light rays actually converge — you can catch them on a screen. Virtual images only appear to be there; rays seem to come from a point behind the lens or mirror. The calculator distinguishes them by sign of d_i: positive d_i (with the standard convention) means real, negative means virtual. A converging lens gives real images for objects beyond f, virtual images for objects inside f. Diverging lenses always give virtual images. Magnification sign reinforces it — real images come with negative m (inverted), virtual ones come with positive m (upright).

Sources and References