Lens Equation Calculator
Solve thin-lens problems for image distance, object distance, or focal length. Includes magnification and sign conventions with step-by-step physics.
Lens Equation Calculator
Background.
The thin-lens equation calculator solves for image distance, object distance, or focal length given any two of these quantities, and computes the linear magnification produced by a spherical lens. This relationship is central to geometric optics, the branch of physics that treats light as rays traveling in straight lines and bending at interfaces. Every camera, eyeglass, microscope, and telescope relies on the thin-lens approximation, and students encounter it in high school physics, undergraduate optics courses, and medical school curricula where the eye is modeled as a variable-focus lens system. The calculator removes the algebraic burden of rearranging the reciprocal equation, allowing users to focus on the physical interpretation of real versus virtual images, upright versus inverted orientations, and the conditions under which the approximation holds.
Search interest in lens equation calculators is driven by both academic and practical needs. Photography enthusiasts learning manual focus need to understand how subject distance and focal length determine image position on a sensor. Optometry students calculate image formation by corrective lenses. Physics undergraduates verify laboratory measurements of object and image distances for converging and diverging lenses. The thin-lens equation is also a standard topic on the Medical College Admission Test and the physics subject GRE, meaning pre-med and graduate-school applicants constitute a significant fraction of search traffic. Unlike more advanced optics tools that require wavefront aberration data or ray-tracing software, the thin-lens equation is solvable with three algebraic variables, making it ideal for a programmatic calculator.
The thin-lens equation is not an exact law of nature but a paraxial approximation valid when light rays make small angles with the optical axis. It was developed from the work of Descartes, who in 1637 published the law of refraction, and later from the systematic lens studies of Isaac Newton and Leonhard Euler. The modern form, 1/f = 1/do + 1/di, assumes the lens thickness is negligible compared with its radii of curvature and object distances. Under this assumption, refraction at the two spherical surfaces can be combined into a single effective bending power characterized by the focal length f. The magnification m = -di/do follows from similar triangles formed by the object, the optical axis, and the chief ray passing through the lens center.
In practice, the thin-lens equation is accurate to within a few percent for most simple lenses used in teaching laboratories, provided the object is not placed extremely close to the focal point where aberrations dominate. Real camera lenses contain multiple elements precisely to violate the thin-lens assumption in a controlled way, correcting chromatic and spherical aberrations that the single-surface model ignores. Nevertheless, the thin-lens equation remains the essential first step in any optical design, establishing the approximate element positions before refinement with ray-tracing software such as Zemax or Code V. For students and hobbyists, it provides quantitative insight into why a 50 millimeter lens focuses distant objects at roughly 50 millimeters from the sensor and why bringing the object closer requires extending the lens farther from the image plane, a principle still visible in the helical focus mechanisms of rangefinder cameras.
What is lens equation calculator?
The thin-lens equation relates the object distance, image distance, and focal length of an idealized lens whose thickness is negligible compared with the radii of its surfaces. For a spherical lens in air, the equation is 1/f = 1/do + 1/di, where do is the distance from the object to the lens center, di is the distance from the lens center to the image, and f is the focal length. All distances are measured in meters or any consistent length unit. The magnification is m = -di/do, a dimensionless ratio describing the image size relative to the object size. A negative magnification indicates an inverted image; a positive magnification indicates an upright image.
The sign convention used here follows the Cartesian convention: light travels from left to right, object distances are positive for real objects on the left side of the lens, and image distances are positive for real images formed on the right side of the lens. Converging lenses have positive focal lengths; diverging lenses have negative focal lengths. The equation is valid only in the paraxial regime, where rays make small angles with the optical axis, and for monochromatic light where dispersion can be neglected. At large apertures or extreme object distances, spherical aberration and coma degrade the image quality beyond what the thin-lens model predicts.
How to use this calculator.
- Measure or note the focal length of the lens from its specification or manufacturer data.
- Measure the distance from the object to the center of the lens.
- Enter the two known distances into the calculator, ensuring consistent units.
- Select the unknown quantity: image distance, object distance, or focal length.
- Review the computed image distance and its sign to determine whether the image is real or virtual.
- Examine the magnification to predict image size and orientation.
- Verify that the object distance satisfies the paraxial approximation for your lens aperture.
The formula.
The thin-lens equation derives from applying the law of refraction at each spherical surface of a lens and then taking the limit where the lens thickness approaches zero. Consider a lens with two spherical surfaces of radii R1 and R2, separating media with refractive indices n_lens and n_surrounding. For a ray passing from object to image through the lens, Snell's law applied at each surface yields two equations relating the object distance, image distance, and surface curvature. When the lens is thin, the intermediate image formed by the first surface serves as the object for the second surface at essentially the same location. Adding the two surface equations and using the small-angle approximation sin θ ≈ θ eliminates the intermediate variable, producing the lensmaker's equation: 1/f = (n_lens/n_medium - 1)(1/R1 - 1/R2).
The lensmaker's equation shows that focal length depends on the refractive index and surface curvatures. For a given lens, these are fixed, so the thin-lens equation 1/f = 1/do + 1/di describes how object and image distances trade off while maintaining the constant focal length. When do approaches infinity, 1/do vanishes and di equals f, defining the focal length as the image distance for an infinitely distant object. When do equals 2f, di also equals 2f and the magnification is -1, producing a real, inverted image the same size as the object. When do is between f and 2f, di exceeds 2f and the magnification is less than -1, producing a real, enlarged, inverted image—the configuration used by projectors.
The magnification formula follows from tracing a ray through the center of the lens, which is undeflected because the two surfaces are locally parallel at the axis. Similar triangles formed by the object height and image height give hi/ho = di/do. The negative sign in m = -di/do encodes the inversion of real images. For virtual images formed by diverging lenses or by converging lenses with objects inside the focal length, di is negative, yielding a positive magnification that indicates an upright, reduced image. This sign convention, while arbitrary in choice, is internally consistent and universally adopted in introductory optics texts.
A worked example.
A converging lens with a focal length of 15.0 centimeters forms an image of an object placed 40.0 centimeters from the lens. To find the image distance, begin with the thin-lens equation 1/f = 1/do + 1/di. Substitute f = 15.0 cm and do = 40.0 cm, giving 1/15.0 = 1/40.0 + 1/di. Subtract 1/40.0 from both sides: 1/di = 1/15.0 - 1/40.0 = (40.0 - 15.0)/(15.0 × 40.0) = 25.0/600 = 1/24.0. Therefore di = 24.0 cm. The positive image distance indicates a real image formed on the opposite side of the lens from the object. The magnification is m = -di/do = -24.0/40.0 = -0.600, meaning the image is inverted and reduced to 60 percent of the object's height. This result agrees with the standard textbook case of an object placed beyond twice the focal length of a converging lens, producing a real, inverted, diminished image between f and 2f on the far side.
Frequently asked questions.
What is the difference between a real image and a virtual image?
Why is the focal length positive for converging lenses and negative for diverging lenses?
Can the thin-lens equation be used for mirrors?
What happens when an object is placed exactly at the focal point?
Why does the magnification have a negative sign?
What are the limits of the thin-lens approximation?
How do I handle the sign convention consistently?
Can I use this calculator for camera lenses?
What is the lensmaker's equation and how does it relate to the thin-lens equation?
Why do objects closer than the focal length produce virtual images?
References& sources.
- [1]Hecht, E. (2017). Optics, 5th ed. Pearson. Ch. 5.
- [2]Smith, W.J. (2008). Modern Optical Engineering, 4th ed. SPIE Press. Ch. 2.
- [3]Pedrotti, F.L., Pedrotti, L.M., & Pedrotti, L.S. (2007). Introduction to Optics, 3rd ed. Pearson. Ch. 3.
- [4]Greivenkamp, J.E. (2004). Field Guide to Geometrical Optics. SPIE Press. Ch. 1.
- [5]Jenkins, F.A. & White, H.E. (2001). Fundamentals of Optics, 4th ed. McGraw-Hill. Ch. 5.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled