Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Physics
  3. /Geometric Optics Calculators
  4. /Lens Calculator

Lens Calculator

Last updated: March 17, 2026

Calculator

Results

Calculated Value

40

cm

Magnification (M)

-1

×

Image Distance Used (dᵢ)

40

cm

Object Distance Used (dₒ)

40

cm

Focal Length Used (f)

20

cm

Image Orientation Code

-1

Image Reality Code

1

Size Change Ratio |M|

1

×

Results

Calculated Value

40

cm

Magnification (M)

-1

×

Image Distance Used (dᵢ)

40

cm

Object Distance Used (dₒ)

40

cm

Focal Length Used (f)

20

cm

Image Orientation Code

-1

Image Reality Code

1

Size Change Ratio |M|

1

×

The Lens Calculator uses the thin lens equation to determine the relationship between focal length, object distance, and image distance for converging and diverging lenses. This fundamental optics tool is essential for understanding how lenses form images in cameras, eyeglasses, microscopes, and telescopes.

The thin lens equation $$\frac{1}{f} = \frac{1}{d_o} + \frac{1}{d_i}$$ connects three key parameters of any thin lens system. By knowing any two values, you can calculate the third and determine the magnification and nature of the resulting image.

Visual Analysis

How It Works

This calculator applies the thin lens equation, one of the cornerstone formulas in geometric optics:

$$\frac{1}{f} = \frac{1}{d_o} + \frac{1}{d_i}$$

Where:

  • f — focal length of the lens (positive for converging, negative for diverging)
  • do — object distance from the lens (always positive for real objects)
  • di — image distance from the lens (positive = real image, negative = virtual image)

The magnification is calculated as:

$$M = -\frac{d_i}{d_o}$$

A negative magnification indicates an inverted image, while a positive magnification indicates an upright image. When |M| > 1 the image is magnified; when |M| < 1 it is diminished.

For a converging lens (f > 0): if the object is beyond the focal point (do > f), a real inverted image forms on the opposite side. If the object is within the focal length (do < f), a virtual upright magnified image forms on the same side as the object.

For a diverging lens (f < 0): the image is always virtual, upright, and diminished regardless of object position. This is why diverging lenses are used to correct nearsightedness.

The thin lens equation assumes the lens thickness is negligible compared to the focal length and object/image distances. This approximation works well for most everyday optical systems but breaks down for thick lenses or very short focal lengths where the lensmaker's equation with principal planes must be used instead.

Understanding Your Results

The calculated value shows whichever parameter you chose to solve for — image distance, object distance, or focal length — in centimeters. A positive image distance means the image forms on the opposite side of the lens from the object (real image), while a negative image distance means it forms on the same side (virtual image).

The magnification tells you both the size ratio and orientation of the image. M = −2 means the image is twice as large and inverted. M = +0.5 means the image is half the size and upright. The image type description summarizes whether the image is real or virtual, inverted or upright, and magnified or diminished.

Worked Examples

Converging Lens — Real Image

Inputs

solve fordi
f20
do val60
di val40

Results

result30
magnification-0.5
image typeReal, Inverted, Diminished

An object placed 60 cm from a lens with f = 20 cm forms a real inverted image at 30 cm. Since 1/20 = 1/60 + 1/30, the image is diminished with M = −0.5.

Converging Lens — Virtual Image (Object Inside Focal Length)

Inputs

solve fordi
f20
do val10
di val40

Results

result-20
magnification2
image typeVirtual, Upright, Magnified

An object at 10 cm from a 20 cm focal length lens produces a virtual image at −20 cm (same side as object). The magnification M = +2 means the image is upright and twice the size — this is how a magnifying glass works.

Frequently Asked Questions

The thin lens equation is $$\frac{1}{f} = \frac{1}{d_o} + \frac{1}{d_i}$$ where f is the focal length, do is the object distance, and di is the image distance. It describes how thin lenses form images and is the foundation of geometric optics for lens systems.

A negative image distance (di < 0) means the image is virtual — it forms on the same side of the lens as the object. Virtual images cannot be projected onto a screen but can be seen by looking through the lens, as with a magnifying glass.

Magnification is M = −di/do. The negative sign means that when di is positive (real image), M is negative (inverted). When di is negative (virtual image), M is positive (upright). The absolute value |M| gives the size ratio.

When do = f, the thin lens equation gives 1/di = 0, meaning di → ∞. The light rays emerge parallel and never converge to form an image. This principle is used in collimators and flashlights to produce parallel beams.

Yes. For diverging lenses, enter a negative focal length. The calculator will show that the image distance is always negative (virtual) and the magnification is always positive and less than 1 (upright, diminished).

This calculator uses the standard sign convention: distances measured in the direction of light propagation are positive. Object distance do is always positive for real objects. Image distance di is positive for real images (opposite side from object) and negative for virtual images. Focal length f is positive for converging lenses and negative for diverging lenses.

Sources & Methodology

Hecht, E. (2017). Optics, 5th Edition. Pearson. | Serway, R. A. & Jewett, J. W. (2018). Physics for Scientists and Engineers, 10th Edition. Cengage. | HyperPhysics — Thin Lens Equation: http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/lenseq.html
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

Mirror Equation Calculator

Geometric Optics Calculators

Magnification Calculator

Geometric Optics Calculators

Focal Length Calculator

Geometric Optics Calculators

Lens Maker Equation Calculator

Geometric Optics Calculators

Snell's Law Calculator

Geometric Optics Calculators

Index of Refraction Calculator

Geometric Optics Calculators