Focal Length Calculator
Find the focal length of a lens given the distance to the object and the distance to the formed image. Essential for photographers, opticians, and physics students working with thin-lens optics.
About this calculator
The thin-lens equation relates the focal length f of a lens to the object distance (dₒ) and image distance (dᵢ). The formula is: 1/f = 1/dₒ + 1/dᵢ, which can be rearranged to f = 1 / (1/dₒ + 1/dᵢ). A positive focal length indicates a converging (convex) lens, while a negative value indicates a diverging (concave) lens. The object distance is measured from the object to the lens, and the image distance from the lens to where the image forms. This relationship is foundational in optics and applies to cameras, eyeglasses, microscopes, and telescopes. Sign conventions matter: real objects and real images carry positive distances under the standard convention.
How to use
Suppose a candle is placed 30 cm in front of a converging lens and its image forms 60 cm on the other side. Enter objectDistance = 30 cm and imageDistance = 60 cm. The calculator computes: f = 1 / (1/30 + 1/60) = 1 / (0.0333 + 0.0167) = 1 / 0.05 = 20 cm. The focal length of this lens is 20 cm. Try changing the image distance to see how moving the screen closer or farther affects the required focal length.
Frequently asked questions
What is the difference between focal length and object distance in lens optics?
Object distance is the measured gap between the physical object and the lens, while focal length is an intrinsic property of the lens itself — the distance at which parallel incoming rays converge to a point. Object distance changes every time you reposition the object, whereas focal length remains constant for a given lens. The thin-lens equation ties the two together along with image distance. Understanding both is critical when designing optical instruments or solving physics problems.
How does focal length affect the image formed by a lens?
A shorter focal length means the lens bends light more sharply, producing a smaller field of view but greater magnification at close range. A longer focal length bends light less, capturing a wider scene but requiring objects to be farther away to form a sharp image. In photography, wide-angle lenses have short focal lengths and telephoto lenses have long ones. For a converging lens, when the object is placed beyond the focal point, a real and inverted image forms on the opposite side.
Why does the focal length formula use reciprocals of the distances?
The thin-lens equation is derived from the geometry of ray optics: two specific rays — one parallel to the axis and one through the optical center — must intersect at the image point. Tracing these rays algebraically yields the reciprocal relationship 1/f = 1/dₒ + 1/dᵢ. Using reciprocals elegantly captures how the convergence contributions of both distances add together. This form also makes it easy to solve for any one of the three quantities when the other two are known.