Thin Lens Equation Calculator - Solve 1/f, 1/do, or 1/di

Use this thin lens equation calculator to solve 1/f = 1/do + 1/di for f, do, or di and read the magnification and image type for converging or diverging lenses.

Updated: June 18, 2026 • Free Tool

Thin Lens Equation Calculator

Focal length of the thin lens in millimeters. Positive for a converging lens, negative for a diverging lens.

Distance from the object to the lens along the optical axis. Must be positive.

Distance from the lens to the image. Positive for a real image, negative for a virtual image. Leave at 0 when solving for di.

Pick which variable to leave blank and let the calculator solve for.

Results

Solved Value
0mm
Solved For 0
Magnification m 0
Focal Power 0D
Image Type 0

What Is Thin Lens Equation Calculator?

A thin lens equation calculator is a fast way to apply the thin lens equation 1/f = 1/do + 1/di to a converging or diverging lens. It solves for any one of the three variables (focal length f, object distance do, or image distance di) and returns the linear magnification and a real, virtual, upright, or inverted image label.

  • Solve a converging-lens homework problem: Compute image distance and magnification for a converging lens given the focal length and the object distance.
  • Check a diverging-lens setup: Confirm that a diverging lens (f negative) always gives a virtual, upright, reduced image.
  • Design a simple magnifier: Pick an object distance inside the focal length of a converging lens and read the virtual, upright, magnified image distance.
  • Convert between focal length and image distance: Solve for f when do and di are already measured, which is what a camera lens calibration gives you.

The thin lens equation is the workhorse of geometric optics. The lensmakers equation gives the focal length f from the refractive index and the surface radii, and this equation then uses that f with an object distance to find where the image forms. Most physics classes introduce it as 1/f = 1/do + 1/di paired with the magnification m = -di / do.

The formula assumes you already know the focal length, and a Lensmakers Equation Calculator is the right tool when you need to compute that focal length from the refractive index and the surface radii of curvature first.

How Thin Lens Equation Calculator Works

The calculator applies the formula in the Cartesian sign convention, treats a positive focal length as a converging lens and a negative focal length as a diverging lens, and guards the divide-by-zero case where the object sits exactly at the focal point and the image distance is infinite.

1/f = 1/do + 1/di and m = -di / do
  • f: Focal length of the thin lens in millimeters. Positive for a converging lens, negative for a diverging lens in the Cartesian sign convention.
  • do: Object distance from the lens in millimeters. Always positive here; the object sits on the incoming-light side of the lens.
  • di: Image distance from the lens in millimeters. Positive for a real image on the outgoing-light side, negative for a virtual image on the incoming-light side.
  • m: Linear magnification m = -di / do. Negative values mean the image is inverted, positive values mean it is upright, and |m| greater than 1 means the image is magnified.

The optical power in diopters is P = 1000 / f(mm), so a stack of thin lenses adds its powers directly: the system power is just the sum of the individual lens powers, and inverting it gives the system focal length.

Converging lens, object outside the focal length (f = 50 mm, do = 150 mm)

f = 50 mm, do = 150 mm, Solve for di

1/di = 1/50 - 1/150 = 0.02 - 0.00667 = 0.01333. di = 1 / 0.01333 = 75 mm.

di = 75 mm, magnification = -0.5, focal power = 20 D, image type = Real, inverted, reduced

The image forms 75 mm past the lens, is half as tall as the object, and is upside down.

Diverging lens (f = -100 mm, do = 200 mm)

f = -100 mm, do = 200 mm, Solve for di

1/di = 1/(-100) - 1/200 = -0.01 - 0.005 = -0.015. di = 1 / (-0.015) = -66.67 mm.

di = -66.67 mm, magnification = 0.333, focal power = -10 D, image type = Virtual, upright, reduced

The image sits 66.67 mm in front of the lens, is one-third the object height, and is right side up.

According to Physics LibreTexts, Section 2.5: Thin Lenses, the thin-lens equation 1/f = 1/do + 1/di is the paraxial form of Snell's law for a lens whose thickness can be ignored, with the magnification m = -di / do sharing the same sign convention as the object and image distances.

This conjugate relation 1/f = 1/do + 1/di is the same one the mirror equation uses, so a Mirror Equation Calculator covers the equivalent reflection setup (concave, convex, or plane mirrors) with the same Solve For selector and sign convention.

Key Concepts Explained

Four ideas come up every time the formula is applied. Understanding them keeps the sign convention and the magnification sign from producing a wrong answer.

Cartesian sign convention

Distances are positive when measured in the direction of light travel and negative when measured against it. The object distance is positive on the incoming-light side, the image distance is positive on the outgoing-light side, and the focal length is positive for a converging lens and negative for a diverging lens.

The equation 1/f = 1/do + 1/di

The three reciprocals add up: one over the focal length equals one over the object distance plus one over the image distance. This reciprocal form is what most physics textbooks teach first.

Linear magnification m = -di / do

The minus sign carries the orientation: negative means inverted, positive means upright, and the absolute value gives the size ratio. A magnifier works by giving a magnification greater than 1 with a positive sign.

Real versus virtual images

A real image forms where light actually converges on the outgoing side, so di is positive. A virtual image forms where light only appears to diverge from on the incoming side, so di is negative. A diverging lens always produces a virtual image for any real object.

The formula gives only the paraxial, on-axis prediction. Off-axis objects and finite apertures pick up additional terms from spherical aberration.

Refractive index n is the ratio c / v where c is the speed of light in vacuum and v is its speed inside the glass, so the same wave relation v = f lambda that defines n also drives a Wave Speed Calculator for the wavelength, frequency, and wave speed inside the lens material.

How to Use This Calculator

Five short steps take you from a focal-length spec and an object distance to an image distance, a magnification, and a real/virtual label.

  1. 1 Pick which variable to solve for: Use the Solve For selector to choose Image distance, Object distance, or Focal length. The other two fields become the inputs.
  2. 2 Enter the focal length with the right sign: Enter f in millimeters. Use a positive value for a converging lens, a negative value for a diverging lens.
  3. 3 Enter the object distance: Enter do in millimeters as a positive number. For a magnifier, set do smaller than f to force a virtual, upright image.
  4. 4 Enter the known distance (or leave it at 0 when solving for di): Enter di in millimeters when you are solving for f or do, with the sign giving real or virtual.
  5. 5 Read the solved value, magnification, power, and image type: Read the solved value in millimeters, the magnification, the focal power in diopters, and the image type label.

For a converging lens with f = 100 mm and do = 250 mm, the calculator returns di = 166.67 mm, m = -0.667, focal power = 10 D, image type = Real, inverted, reduced.

Benefits of Using This Calculator

The calculator gives you the image distance, the magnification, the optical power, and the image type label in a single pass.

  • Solve for any one of f, do, or di: Switch the Solve For selector and the same calculator returns the focal length, the object distance, or the image distance, with the right units each time.
  • Catch sign errors quickly: The image type label reads 'Real, inverted, reduced' or 'Virtual, upright, magnified' directly from the signs, which makes it easy to spot a flipped sign on do or f.
  • Read the magnification with its sign: Linear magnification m = -di / do is shown to three decimal places with the sign, so upright and inverted images are visible at a glance.
  • Use diopters for stacked-lens systems: The focal power output in diopters lets you add the powers of stacked thin lenses and invert the sum for the system focal length, which is how optometrists combine prescriptions.
  • Cover both thin and thick lens practice: Use d = 0 to get the thin-lens form, or pair this calculator with a lensmakers equation calculator to plug in the focal length for a thick lens.

Optics students, makers building a magnifier or a simple projector, and photographers who want to double-check an effective focal length all benefit from the same reciprocal-algebra shortcut.

Factors That Affect Your Results

Five inputs drive the result the most, plus two caveats to keep in mind before quoting a measurement.

Focal length f

Controls image position and size. Doubling f for a fixed object distance roughly doubles the image distance and halves the optical power.

Object distance do

Sets the regime. When do is greater than f, a converging lens makes a real, inverted image. When do is less than f, the same lens makes a virtual, upright, magnified image.

Image distance di

The answer in most textbook problems, but it is the input when you already have a measured image and need to back out do or f.

Sign of f for diverging lenses

A negative focal length flips the image to virtual and upright for every positive object distance, and the optical power is negative, which is how eyeglass prescriptions for myopia work.

Wavelength (dispersion)

Refractive index depends on wavelength, so the focal length depends on the design wavelength. A chromatic lens produces slightly different image distances for red and blue light.

  • The formula assumes lens thickness is negligible compared with the radii of curvature. For thick lenses, use the lensmakers equation with the center-thickness correction.
  • The equation is paraxial, so it ignores spherical aberration, off-axis coma, and finite-aperture diffraction. Treat the result as a small-angle, on-axis prediction and verify with a ray trace for precision work.

If the result disagrees with a measured image position, the most common cause is the sign convention. Re-check the focal length sign, the image-distance sign, and whether the object distance is measured to the lens center.

According to HyperPhysics - Thin lens formulas, a positive focal length denotes a converging lens and a negative focal length denotes a diverging lens, with a positive image distance meaning a real image and a negative image distance meaning a virtual image.

According to OpenStax - College Physics 2e: Image Formation by Lenses, a converging lens forms a real image on the side opposite the object when do is greater than f, and a virtual, upright, magnified image on the same side as the object when do is less than f.

The light-gathering power of the same lens depends on the area of its opening, and an Aperture Area Calculator returns that area from the lens diameter or from the focal length and f-number, on the same image-formation framework as this equation.

Thin lens equation calculator interface with focal length, object distance, image distance, magnification, focal power, and image type outputs
Thin lens equation calculator interface with focal length, object distance, image distance, magnification, focal power, and image type outputs

Frequently Asked Questions

Q: What is the thin lens equation?

A: The thin lens equation is the geometric-optics relation 1/f = 1/do + 1/di, where f is the focal length, do is the object distance, and di is the image distance. It is the paraxial, on-axis form of Snell's law for a lens thin enough that its thickness can be ignored, and it pairs with the magnification m = -di / do.

Q: How do you solve the thin lens equation for image distance?

A: Rearrange 1/f = 1/do + 1/di to di = 1 / (1/f - 1/do). Plug in the focal length f and the object distance do, subtract 1/do from 1/f, and take the reciprocal to get the image distance. The sign of di tells you whether the image is real (positive) or virtual (negative).

Q: What is the magnification formula for a thin lens?

A: The linear magnification is m = -di / do. A negative sign means the image is inverted, a positive sign means it is upright, and the absolute value gives the size ratio. A magnifier has m greater than 1 with a positive sign, while a projector typically has m less than 0 with an absolute value of 1 or more.

Q: What sign convention does the thin lens equation use?

A: The thin lens equation uses the Cartesian sign convention. The object distance do is positive on the incoming-light side, the image distance di is positive on the outgoing-light side, and the focal length f is positive for a converging lens and negative for a diverging lens. A negative di means the image is virtual and forms on the same side as the object.

Q: How do you know if a thin lens image is real or virtual?

A: Look at the sign of the image distance di. A positive di means the image forms on the outgoing-light side of the lens and is real. A negative di means the image forms on the incoming-light side and is virtual. A diverging lens always gives a virtual image for any positive object distance, while a converging lens gives a real image when do is greater than f and a virtual image when do is less than f.

Q: What is the difference between the thin lens equation and the lensmakers equation?

A: The lensmakers equation calculates the focal length f from the refractive index n of the glass and the surface radii of curvature R1 and R2. The thin lens equation then uses that f with the object and image distances to predict where the image forms. Use the lensmakers equation to design or check a lens, and use the thin lens equation to find where the image lands for a given setup.