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.
Result
Ray diagram for a convex lens with object beyond 2F. Image is real, inverted, and reduced.
How to Use the Calculator
- Select the quantity you want to calculate (f, dₒ, or dᵢ) from the dropdown in the left panel.
- Enter the other two known values in the input fields.
- Choose the appropriate optical element (lens or mirror type).
- Select your preferred units (cm or m).
- Click "Calculate" or the result will update automatically.
- 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:
| 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
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.)