Lens Focal Length Calculator

Find focal length using thin lens inputs. See power, magnification, and lens behavior in seconds. Graph results, compare examples, and export polished study reports.

Calculator Input

Input guide: Enter a positive object distance for a real object. Enter a positive image distance for a real image and a negative image distance for a virtual image.
Reset Inputs

Formula Used

The calculator uses the thin lens equation:

1 / f = 1 / do + 1 / di

Rearranging for focal length gives:

f = (do × di) / (do + di)

It also computes lens power and magnification:

  • Power: P = 1 / f, where f is in meters.
  • Magnification: m = -di / do.

How to Use This Calculator

  1. Enter the object distance as a positive value.
  2. Enter the image distance using optics sign convention.
  3. Choose your preferred distance unit.
  4. Select decimal places and graph resolution.
  5. Optionally add a label for your setup.
  6. Press Calculate Focal Length.
  7. Review focal length, power, magnification, and lens type.
  8. Export your results as CSV or PDF if needed.

Example Data Table

Use any example below to test the calculator quickly.

Example do di f Power Magnification Lens Type
Example 1 30 cm 60 cm 20 cm 5.00 D -2.00 Converging lens
Example 2 50 cm -25 cm -50 cm -2.00 D 0.50 Diverging lens
Example 3 100 cm 25 cm 20 cm 5.00 D -0.25 Converging lens
Example 4 24 cm -12 cm -24 cm -4.17 D 0.50 Diverging lens

FAQs

1. What formula does this calculator use?

It uses the thin lens equation, 1/f = 1/do + 1/di. The page also rearranges it to f = (do × di) / (do + di) for direct focal length calculation.

2. Why can image distance be negative?

A negative image distance represents a virtual image under the chosen sign convention. This commonly happens with diverging lenses or when an object lies inside a converging lens focal length.

3. What does a positive focal length mean?

A positive focal length indicates a converging lens. These lenses bring parallel light rays together and can produce real images when the object is placed beyond the focal point.

4. What does a negative focal length mean?

A negative focal length indicates a diverging lens. These lenses spread light outward and usually form virtual, upright, and reduced images for real objects.

5. Why did I get an infinite focal length warning?

That appears when do + di becomes zero in the denominator. Mathematically, the lens behaves like an aphocal limit, so the focal length cannot be represented as a finite number.

6. What is lens power in diopters?

Lens power is the reciprocal of focal length in meters. Stronger converging lenses have larger positive power, while diverging lenses have negative power.

7. What does magnification tell me?

Magnification describes image size and orientation. A positive value means upright, a negative value means inverted, and the absolute value shows whether the image is enlarged or reduced.

8. Can I use this for mirrors too?

This page is designed for thin lenses. Mirror equations look similar, but sign conventions and interpretation can differ, so a dedicated mirror calculator is the safer choice.

Related Calculators

Phase shift calculatorThermistor beta calculatorCalibration curve solverUncertainty budget builderFFT frequency resolutionSNR measurement estimatorWindow leakage estimatorJohnson noise calculatorFWHM calculatorScattering vector q

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.