---
slug: lens-equation-calculator
title: "Lens Equation Calculator"
category: scientific
updated: 2026-11-18
canonical: https://calcseed.com/c/scientific/lens-equation-calculator/
html: /c/scientific/lens-equation-calculator/
---

# Lens Equation Calculator

Calculate the image distance and magnification of a thin lens from its focal length and object distance.

## Quick answer

**Quick answer:** with the default inputs (10 cm, 30 cm), the image distance is **15**. At these inputs: magnification = **-0.5**. Change any input to update the result.

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| Focal length | 10 | cm |
| Object distance | 30 | cm |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Image distance | 15 |  |
| Magnification | -0.5 |  |

## Formula

```text
1/f = 1/d_o_ + 1/d_i_
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| Focal length | number | cm | 10 |
| Object distance | number | cm | 30 |

## Outputs

| Result | Format |
| --- | --- |
| Image distance | primary |
| Image distance | number |
| Magnification | number |

## How it works

### What this calculator returns

It returns the image distance d_i_ in cm and the linear magnification m. At the defaults — a 10 cm focal length lens and an object 30 cm away — the image forms 15 cm behind the lens with a magnification of −0.5000, so it is half-size and inverted.

### The sign conventions do the work

A converging lens has a positive focal length and a diverging lens a negative one. Object distance is positive when the object sits on the incoming side, which is the normal case for a camera, an eye or a projector. Only the image distance and the magnification change sign, and those signs carry the physical meaning.

A positive d_i_ means a real image on the far side of the lens, the kind you can catch on a screen. A negative d_i_ means a virtual image on the same side as the object, visible only by looking through the lens. At the defaults d_i_ = +15 cm, so the image is real.

Magnification is m = −d_i_ ÷ d_o_, and the minus sign is deliberate. A negative m means the image is inverted relative to the object. At the defaults m = −15 ÷ 30 = −0.5, so the image is upright-flipped and half the height of the object.

### Worked example at the defaults

Take f = 10 cm and d_o_ = 30 cm. Then 1/d_i_ = 1/10 − 1/30 = 0.1000 − 0.0333 = 0.0667 cm^−1, so d_i_ = 1 ÷ 0.0667 = 15 cm. The image sits 15 cm past the lens, inside the 20 cm focal point on the far side.

Magnification follows directly: m = −15 ÷ 30 = −0.5. A 4 cm tall object produces a 2 cm tall inverted image. Move the object to 15 cm and the arithmetic gives d_i_ = 30 cm with m = −2, a doubled image at twice the distance.

### Image position for a 10 cm lens

| Object distance | Image distance | Magnification | Image type |
| --- | --- | --- | --- |
| 5 cm (inside focus) | −10 cm | +2.0 | Virtual, upright, enlarged |
| 10 cm (at focus) | none | — | Rays emerge parallel |
| 15 cm | 30 cm | −2.0 | Real, inverted, enlarged |
| 20 cm (2f) | 20 cm | −1.0 | Real, inverted, same size |
| 30 cm (default) | 15 cm | −0.5 | Real, inverted, reduced |
| 40 cm | 13.3 cm | −0.33 | Real, inverted, much reduced |

#### What happens at the focal point

Set d_o_ = f = 10 cm and the two terms on the right cancel, so 1/d_i_ = 0 and the image distance goes to infinity. This is the collimator setting: the lens turns a point source into a parallel beam, which is why a magnifying glass held exactly one focal length above a page gives no image you can focus.

Just inside the focal point the sign flips. At 5 cm the calculation gives 1/10 − 1/5 = −0.100, so d_i_ = −10 cm and m = +2. The image is virtual, upright and twice the size, exactly the behaviour of a magnifying glass used as intended.

#### Rules of thumb for a converging lens

- Object beyond 2f: real, inverted, reduced, with the image between f and 2f.
- Object exactly at 2f: real, inverted, same size, image also at 2f.
- Object between f and 2f: real, inverted, enlarged, image beyond 2f.
- Object inside f: virtual, upright, enlarged, image on the same side as the object.

### What moves the image

- Object distance: pushing the object from 30 cm to 40 cm pulls the image from 15 cm to 13.3 cm and shrinks m from −0.5 to −0.33.
- Focal length: a 20 cm lens at the same 30 cm object distance puts the image at 60 cm with m = −2.
- Lens type: a diverging lens with f = −10 cm at 30 cm gives d_i_ = −7.5 cm and m = +0.25, always virtual and reduced.
- Object height: does not affect d_i_ at all, only the size of the image through m.
- Medium: immersing the lens changes its effective focal length, shifting every distance in the table.

### Mistakes that invert the answer

The most common slip is dropping the reciprocal at the end. Solving for 1/d_i_ = 0.0667 and reporting d_i_ = 0.0667 cm is wrong by a factor of 225. The quantity you just computed is one over the distance, so invert it before writing the answer down.

The second is forgetting the minus sign in m = −d_i_ ÷ d_o_. Without it the default result reads +0.5 and the image appears upright, which contradicts the ray diagram for a real image. Sign errors like this are why camera and projector calculations sometimes place the sensor on the wrong side of the lens.

The third is mixing centimetres and metres in the same calculation. All three lengths must share a unit; the formula is homogeneous, so 10 cm with 0.30 m gives an answer in metres that will not match the centimetre inputs.

### Where the equation gets used

A phone camera with a 4 mm lens focused at 1 m needs its sensor 4.016 mm behind the lens, which is why autofocus travel is measured in fractions of a millimetre. A projector throwing a 1.5 m wide image from 4 m uses the same equation in reverse to pick a lens with the right throw ratio.

## FAQ

### What is the thin lens equation?

It is 1/f = 1/d_o_ + 1/d_i_. With f = 10 cm and d_o_ = 30 cm, 1/d_i_ = 0.1 − 0.0333 = 0.0667, so d_i_ = 15 cm.

### What does a negative image distance mean?

The image is virtual and sits on the same side as the object. A 10 cm lens with the object 5 cm away gives d_i_ = −10 cm and a magnification of +2.

### How is magnification calculated?

m = −d_i_ ÷ d_o_. At the defaults that is −15 ÷ 30 = −0.5, a half-size inverted image. A negative m always means inverted.

### Why is the image at 2f the same size as the object?

When d_o_ = 2f the equation gives d_i_ = 2f as well, so m = −20 ÷ 20 = −1. This is the 1:1 imaging position used for copying.

### What happens when the object is at the focal point?

The image distance goes to infinity. At d_o_ = 10 cm with f = 10 cm, 1/d_i_ = 0, so the rays leave parallel and no image forms.

### How do I handle a diverging lens?

Give the focal length a negative sign. A lens with f = −10 cm and an object at 30 cm produces d_i_ = −7.5 cm and m = +0.25, a virtual upright image one quarter the size.

### Does object height change the image distance?

No. The equation uses only f and d_o_; height enters only through magnification. A 4 cm object at 30 cm images at 15 cm just like a 40 cm object would.

### Why did I get an image distance near zero?

You probably reported the reciprocal. For the defaults 1/d_i_ = 0.0667 cm^−1, so the distance is 1 ÷ 0.0667 = 15 cm, not 0.0667 cm.

### What magnification does a projector need?

A 1.5 m wide image from a 25 mm slide is 60×, so with a 50 mm lens the throw distance solves to about 3.05 m.

## Method and sources

Methodology: Physical constants follow CODATA 2022 recommended values, and formulas follow standard physics definitions.

Last updated: 2026-11-18.
- Thin lens equation 1/f = 1/do + 1/di; magnification m = −di/do.
