Lens & Mirror Equation Calculator – Optics Made Easy

Calculate focal length, object distance, or image distance using the lens/mirror equation with this interactive physics tool.

Object Distance (dₒ) cm
Image Distance (dᵢ) cm
Focal Length (f) cm
Result
Using equation: 1/f = 1/dₒ + 1/dᵢ
Focal Length (f) = 20 cm
Image is real and inverted.

Ray diagram for a convex lens with object beyond 2F. Image is real, inverted, and reduced.

How to Use the Calculator
  1. Select the quantity you want to calculate (f, dₒ, or dᵢ) from the dropdown in the left panel.
  2. Enter the other two known values in the input fields.
  3. Choose the appropriate optical element (lens or mirror type).
  4. Select your preferred units (cm or m).
  5. Click "Calculate" or the result will update automatically.
  6. Review the result and check the ray diagram for visualization.
Understanding the Results

The lens/mirror equation relates the focal length (f), object distance (dₒ), and image distance (dᵢ):

1/f = 1/dₒ + 1/dᵢ

Sign conventions are important in optics:

  • Positive image distance (dᵢ): Real image (formed on the opposite side of the lens)
  • Negative image distance (dᵢ): Virtual image (formed on the same side as the object)
  • Positive focal length (f): Converging lens or concave mirror
  • Negative focal length (f): Diverging lens or convex mirror
Example Calculations

Click on any example to load it into the calculator:

Scenario Object Distance (dₒ) Image Distance (dᵢ) Focal Length (f)
Convex lens, object beyond 2F 30 cm 60 cm 20 cm
Concave lens, virtual image 15 cm -30 cm -10 cm
Convex lens, object at 2F 20 cm 20 cm 10 cm
Concave mirror, object beyond C 40 cm 13.33 cm 10 cm
Convex mirror, virtual image 0.5 m -0.2 m -0.33 m
The Gaussian Lens Formula

This calculator implements the Gaussian lens formula (also called the thin lens equation), which is fundamental to geometric optics. The equation derives from Snell's Law of refraction applied to spherical surfaces under the paraxial approximation (small angles relative to the optical axis).

Primary Equation:
1/f = 1/dₒ + 1/dᵢ
Symbol Quantity SI Unit Description
f Focal Length meters (m) Distance from lens/mirror to focal point
dₒ Object Distance meters (m) Distance from object to optical element (always positive)
dᵢ Image Distance meters (m) Distance from image to optical element
Real-World Applications
  • Camera lenses: Determining focus distance and depth of field
  • Eyeglasses: Correcting vision by creating appropriate virtual images
  • Telescopes & Microscopes: Magnifying distant or small objects
  • Projectors: Creating enlarged real images on screens
  • Rearview mirrors: Convex mirrors providing wide field of view
  • Medical endoscopes: Fiber optics and lens systems for internal imaging
Model Assumptions & Limitations

This calculator uses the thin lens approximation with these assumptions:

  • Lens thickness is negligible compared to focal length
  • Paraxial rays (small angles relative to optical axis)
  • Monochromatic light (single wavelength)
  • Perfect spherical surfaces
  • No aberrations (spherical, chromatic, etc.)
  • Homogeneous medium (usually air) on both sides

Note: Real optical systems may deviate due to lens thickness, material dispersion, and manufacturing imperfections.

Common Student Misconceptions
  • Virtual vs. Real Images: Virtual images cannot be projected on screens but are visible when looking through the optical element.
  • Sign Convention Consistency: Different textbooks use different sign conventions. This calculator uses the "real is positive" convention common in introductory physics.
  • Infinite Image Distance: When object is at focal point (dₒ = f), dᵢ approaches infinity – parallel rays emerge, forming no finite image.
  • Magnification: The magnification equation M = -dᵢ/dₒ is separate from the lens equation but related through sign conventions.
Accuracy & Rounding Notes
  • Results are rounded to 2 decimal places for display clarity
  • Internal calculations use full JavaScript floating-point precision
  • Units are converted internally: 1 m = 100 cm
  • Division by zero is prevented by input validation
  • Extreme values may cause numerical instability due to floating-point limitations
Frequently Asked Questions
The sign indicates optical power direction. Positive focal length (converging) brings parallel rays to a real focus. Negative focal length (diverging) makes parallel rays appear to originate from a virtual focus behind the element.
The lensmaker's equation 1/f = (n-1)(1/R₁ - 1/R₂) calculates focal length from material refractive index (n) and surface radii (R). This calculator uses that result in the Gaussian formula to find image/object distances.
For converging elements (convex lens, concave mirror), when dₒ < f, the image becomes virtual (dᵢ negative), upright, and enlarged. This is how magnifying glasses work.
Not directly, but once you have dᵢ and dₒ, magnification M = -dᵢ/dₒ. Negative M indicates inverted image; |M| < 1 indicates reduced size; |M| > 1 indicates enlarged.
Academic Integrity Note

This calculator is designed as an educational tool to verify manual calculations and visualize optical principles. For academic assignments, always show your work and understand the underlying physics rather than solely relying on computational tools.

Formula accuracy reviewed: November 2025 | Based on: Hecht, E. (2017). Optics (5th ed.) and Young, H. D., & Freedman, R. A. (2020). University Physics (15th ed.)