Skip to content
Physics

Thin Lens Equation Calculator

Enter any two of the three thin-lens quantities - object distance, image distance, or focal length - and this calculator solves the third instantly. It also gives the lateral magnification, the image height from the object height, and classifies whether the image is real or virtual, upright or inverted. Switch between centimetres, metres, and millimetres. The "show your work" panel walks through every arithmetic step.

Your details

Choose which quantity you want the calculator to find.
Distance from the object to the centre of the lens. Always positive.
cm
Positive = converging lens. Negative = diverging lens.
cm
Used to compute the image height. Leave blank to skip.
cm
Solved valueReal, Inverted image
60

The quantity you asked the calculator to find.

Focal length (f)20
Object distance (do)30
Image distance (di)60
Magnification (M)-2
Magnification (|M|)2
Image height (hi)-10
Image typeReal
Image orientationInverted
Lens scenarioCase 3: f < do < 2f - real, inverted, magnified
Object distance (do)30
Image distance (di)60
Focal length (f)20
02104202191160
Object distance do (cm)

Image at 60.00 cm from the lens (real, inverted).

  • The focal length is 20.00 cm, so this is a converging (convex) lens.
  • The image is real and inverted. A real image forms on the opposite side of the lens from the object and can be projected onto a screen.
  • The image is 2.00 times larger than the object (magnified). Because M is negative, it appears flipped.

Next stepScenario context: Case 3: f < do < 2f - real, inverted, magnified. Use the reference table below to see how this case compares with the other four standard converging-lens scenarios.

What is the thin lens equation?

The thin lens equation relates three quantities: the object distance (do), the image distance (di), and the focal length (f) of a lens. It is written as 1/do + 1/di = 1/f. A "thin lens" is an idealised lens whose thickness is negligible compared with the distances involved, so refraction is treated as happening at a single plane. The equation holds for both converging (convex) and diverging (concave) lenses, provided you follow the real-is-positive sign convention: do is always positive (the object is on the incoming-light side), di is positive for a real image and negative for a virtual image, and f is positive for a converging lens and negative for a diverging lens.

How to use this calculator

Select what you want to solve for from the "Solve for" dropdown - image distance, object distance, focal length, or magnification. Then enter the two known quantities. The calculator fills in the unknown instantly and also shows the lateral magnification (M = -di/do), the absolute magnification, the image type (real or virtual), and the image orientation (inverted or upright). If you enter an object height, the image height is computed as well. The "show your work" panel lists every arithmetic step so you can follow along or check an answer from a textbook.

Magnification, image height, and the five lens cases

Lateral magnification is defined as M = -di/do. A negative M means the image is inverted (upside down relative to the object), which happens whenever the image is real. A positive M means the image is upright, which happens for virtual images. The absolute value |M| tells you how many times taller or shorter the image is compared with the object. If you know the object height (ho), the image height is hi = M times ho. For a converging lens there are five standard scenarios depending on where the object sits relative to the focal point: beyond 2f, exactly at 2f, between f and 2f, exactly at f (image at infinity), and inside f (virtual image). The reference table below summarises all five cases. A diverging lens always produces a virtual, upright, and diminished image regardless of the object position.

Sign convention and common mistakes

The most frequent source of error with the thin lens equation is sign confusion. Under the real-is-positive convention, the object distance do must always be positive because the object is on the side light comes from. The focal length f is positive for a converging lens and negative for a diverging lens. The image distance di can be either sign: positive when the image forms on the far side of the lens (a real image that can be projected), and negative when the image appears to be on the same side as the object (a virtual image that cannot be projected). Magnification carries a sign too: M is negative for real, inverted images and positive for virtual, upright images. Keep the signs consistent and the equation gives the correct answer for every case.

Five standard cases for a converging lens

Object positionImage distanceImage typeOrientationSize vs object
do > 2ff < di < 2f Real InvertedDiminished
do = 2fdi = 2f Real InvertedSame size
f < do < 2fdi > 2f Real InvertedMagnified
do = fInfinity No image --
do < fdi < 0 (same side) Virtual UprightMagnified
Diverging lens (any do)di < 0 Virtual UprightDiminished

The position of the object relative to the focal length (f) determines the nature of the image formed.

Frequently asked questions

What is the thin lens equation?

The thin lens equation is 1/do + 1/di = 1/f, where do is the object distance, di is the image distance, and f is the focal length. Given any two of the three quantities, you can solve for the third by rearranging the equation.

What does a negative image distance mean?

Under the real-is-positive sign convention, a negative image distance (di < 0) means the image is virtual. A virtual image forms on the same side of the lens as the incoming light (the same side as the object), appears upright, and cannot be projected onto a screen. This always happens when an object is placed inside the focal length of a converging lens, and for all object positions with a diverging lens.

How do I find the focal length from two distances?

Rearrange the thin lens equation: 1/f = 1/do + 1/di. Measure or look up the object distance and image distance, then invert their sum. For example, if an object is 30 cm from a lens and the image forms 60 cm away, then 1/f = 1/30 + 1/60 = 3/60, so f = 20 cm.

What is lateral magnification?

Lateral magnification M = -di/do tells you the ratio of image height to object height and whether the image is inverted. A negative M means the image is inverted (real image), a positive M means it is upright (virtual image). The absolute value |M| gives the size ratio: |M| > 1 means the image is larger than the object, |M| < 1 means it is smaller.

What is the difference between a converging and a diverging lens?

A converging (convex) lens has a positive focal length. It bends parallel rays toward a focal point on the far side, can form real or virtual images depending on object position, and is used in cameras, projectors, and magnifying glasses. A diverging (concave) lens has a negative focal length. It bends parallel rays away from the axis, always forms virtual, upright, and diminished images, and is used in eyeglasses for nearsightedness.

What happens when the object is exactly at the focal point?

When do = f, the term 1/di in the thin lens equation becomes zero (1/f - 1/f = 0), which means di is infinite. The refracted rays emerge parallel and never converge to form an image at any finite distance. This principle is used in searchlights and flashlights: placing the light source at the focal point produces a parallel beam.

Sources

Written by Dr. Tomás Okafor, PhD Physicist · Lagos, Nigeria

Physicist specializing in classical mechanics, bringing 17 years of research and applied dynamics expertise to every calculator he reviews.

Search 3,500+ calculators

Loading search…