Thin Lens Focal Length Calculator

The thin-lens equation relates the focal length of a lens to the distances of an object and its image: 1/f = 1/do + 1/di. You can solve for any one of the three quantities when you know the other two. This calculator solves for focal length given object distance (do) and image distance (di), but you can also rearrange: solving for di gives di = 1/(1/f - 1/do), and solving for do gives do = 1/(1/f - 1/di). Enter any two values and the calculator will find the third. The thin-lens approximation holds when the lens thickness is small compared to the object and image distances, which covers most camera lenses, eyeglasses, and laboratory optical setups.

Distance from object to lens (positive = real object)
Distance from lens to image (positive = real image)
20.00 cm
Real image

Thin-lens equation formula

1/f = 1/do + 1/di

Where f is focal length, do is object distance, and di is image distance, all in the same units. Rearranged: f = (do x di) / (do + di).

How to use the thin-lens equation

  • Use the same units for all three distances (cm, mm, or m).
  • Object distance do is positive when the object is on the side from which light approaches the lens (the standard case).
  • Image distance di is positive for real images (formed on the far side of the lens) and negative for virtual images.
  • A positive focal length means a converging (convex) lens; a negative focal length means a diverging (concave) lens.
  • When the object is placed at exactly the focal point (do = f), the image is at infinity and rays emerge parallel.

Thin lens calculator: frequently asked questions

What is the thin-lens equation?

The thin-lens equation is 1/f = 1/do + 1/di, where f is the focal length, do is the object distance from the lens, and di is the image distance from the lens. It applies to converging (convex) and diverging (concave) lenses when lens thickness is negligible compared to the other distances.

What sign convention is used?

This calculator uses the standard real-is-positive sign convention. Object distances are positive when the object is on the incoming light side (usual case). Image distances are positive for real images formed on the opposite side of the lens from the object, and negative for virtual images on the same side as the object.

What does a negative focal length mean?

A negative focal length indicates a diverging (concave) lens. Diverging lenses always produce virtual, upright, and reduced images. A positive focal length corresponds to a converging (convex) lens, which can produce real or virtual images depending on object position.

When is an image real versus virtual?

A real image is formed when di is positive: light rays actually converge at the image location. A virtual image occurs when di is negative: rays diverge and appear to originate from a point behind the lens. Real images can be projected on a screen; virtual images cannot.

What is meant by the object being at infinity?

When the object is very far away (do approaches infinity), 1/do approaches zero, so the image forms at the focal point: di = f. This is why the focal length is defined as the image distance when parallel rays (from infinity) converge through the lens.

Official sources

  • OpenStax University Physics Volume 3, Chapter 2: Geometric Optics and Image Formation. openstax.org.
  • NIST Physical Measurement Laboratory, "Fundamental Physical Constants." physics.nist.gov.

Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.