Lens Equation Calculator
Solve the thin lens equation (1/f = 1/do + 1/di) for any unknown. Shows magnification, image type (real/virtual), orientation (upright/inverted), and relative size.
Key Formulas
1/f = 1/do + 1/di | M = -di/do | Power (diopters) = 1/f(m)
Calculate
Select what to solve for, then enter the two known values. Use negative values for diverging lenses or virtual images.
Quick Examples
About This Tool
The Lens Equation Calculator solves the thin lens equation (1/f = 1/do + 1/di) for any unknown variable given the other two. Beyond the basic calculation, it determines the magnification (M = -di/do) and characterizes the resulting image as real or virtual, upright or inverted, and enlarged or diminished. This makes it an indispensable tool for physics students studying optics, photographers understanding lens behavior, optometrists prescribing corrective lenses, and engineers designing optical instruments.
The Thin Lens Equation Explained
The thin lens equation 1/f = 1/do + 1/di is derived from geometric optics by tracing light rays through an idealized lens of negligible thickness. Here, f is the focal length (the distance from the lens to the point where parallel rays converge), do is the object distance (from the object to the lens), and di is the image distance (from the lens to where the image forms). This equation applies to both converging lenses (f > 0, also called convex lenses) and diverging lenses (f < 0, also called concave lenses). The sign convention is critical: positive image distances indicate real images on the far side of the lens, while negative values indicate virtual images on the same side as the object.
Understanding Magnification
The magnification M = -di/do tells you everything about how the image compares to the object. The absolute value |M| gives the size ratio: |M| = 2 means the image is twice as tall as the object. The sign indicates orientation: positive M means the image is upright (same orientation as the object), and negative M means inverted (flipped upside down). A magnifying glass held close to text produces M > 1 (enlarged and upright), because the object is inside the focal length, creating a virtual image. A projector lens creates a real, inverted, enlarged image (M < -1) on the screen, which is why projector slides must be inserted upside-down (or the optics include a correction).
Real vs. Virtual Images
A real image forms where light rays physically converge after passing through the lens. You can place a screen at that location and see the image projected on it. Cameras, projectors, and the human eye all form real images. A virtual image, by contrast, forms where light rays appear to diverge from but never actually pass through. You cannot project a virtual image onto a screen. The image you see in a flat mirror is virtual, as is the enlarged image through a magnifying glass when the object is closer than the focal length. Virtual images are seen by looking through the lens (or mirror), not by projecting onto a surface.
Converging vs. Diverging Lenses
Converging (convex) lenses are thicker in the middle than at the edges. They bend parallel light rays inward to a focal point and have positive focal lengths. They can produce both real and virtual images depending on the object placement. Diverging (concave) lenses are thinner in the middle and spread light rays apart. They have negative focal lengths and always produce virtual, upright, diminished images of real objects. Eyeglasses for nearsightedness (myopia) use diverging lenses, while reading glasses for farsightedness (hyperopia) use converging lenses. The strength of a lens is measured in diopters, defined as 1/f where f is in meters.
Applications in Photography
Every camera lens obeys the thin lens equation (or its thick-lens generalization). When you focus a camera, you are adjusting the lens-to-sensor distance (di) to match the object distance (do) for a given focal length (f). A 50mm lens focused on an object 2 meters away produces an image at approximately 51.3mm behind the lens. Zoom lenses change the effective focal length, altering both the magnification and field of view. Understanding the lens equation helps photographers predict depth of field, choose appropriate focal lengths, and understand why close-up photography requires significant lens extension (macro lenses).
Compound Lenses and Optical Instruments
Telescopes, microscopes, and other optical instruments combine multiple lenses. The image formed by the first lens (objective) serves as the object for the second lens (eyepiece). By cascading the thin lens equation, you can analyze the entire optical system. A compound microscope uses an objective lens to form a real, enlarged, inverted image inside the tube, and an eyepiece to further magnify that intermediate image. The total magnification is the product of the individual magnifications. Modern optical systems may contain dozens of lens elements to correct aberrations, but the fundamental thin lens equation remains the starting point for all optical design.
Frequently Asked Questions
What is the thin lens equation?
What is the sign convention for lenses?
What is the difference between a real and virtual image?
What does magnification tell you?
How does this apply to cameras and eyeglasses?
What are the limitations of the thin lens equation?
Was this tool helpful?