Advertisement

Focal length calculator

A lens forms an image whose size is set by the focal length and the distance to the subject. Photography guides often describe a subject as this many millimetres on the sensor, and that measurement is enough to recover the focal length. Enter any three of focal length, image size, object size and distance to find the fourth, using the thin lens model.

Calculator

Focal length
118.577
Image size on the sensor
24
Subject distance
10
Magnification
0.01200
Reproduction ratio
1:83.33

Advertisement

How this calculator works

A thin lens obeys 1/f = 1/u + 1/v, where u is the distance from the lens to the subject and v is the distance from the lens to the image. Magnification is the image size divided by the object size, and it also equals v / u. Combining the two gives the focal length directly from a measurement of the image: f = u x m / (1 + m). This works well for subjects that are far compared with the focal length, which covers most photography. At very close range the distance should be measured from the lens, not from the camera body, and the thin lens model begins to drift because a real lens has a nodal point and internal focusing.

Formula

magnification m = image size / object size. focal length f = u x m / (1 + m), with u the subject distance. image size = object size x m where m = f / (u - f). subject distance u = f x (1 + m) / m.

Worked example

A two metre tall subject is recorded 24 millimetres tall on the sensor from ten metres away. The magnification is 0.024 / 2 = 0.012, so the focal length is 10 x 0.012 / 1.012 = 0.11858 metres, or 118.6 millimetres. Going the other way, a 50 mm lens at five metres gives a magnification of 0.05 / 4.95 = 0.010101, so a one metre subject fills 10.1 millimetres of the sensor. A one metre subject that must fill 20 millimetres with a 100 mm lens needs a distance of 0.1 x 1.02 / 0.02 = 5.1 metres.

Advertisement

Frequently asked questions

Should distance be measured from the lens or the camera?

From the optical centre of the lens, which is close to the front element for simple designs but can be inside a complex zoom. At macro distances the difference matters, so measure from the marked focal plane if the camera has one.

Why does my measured focal length differ from the marked one?

Lenses change focal length as they focus closer, a behaviour called focus breathing, and the marked value is usually specified at infinity. Measurement error in the image size also matters, so use a large, sharp target.

What is the reproduction ratio?

It is the magnification written as a ratio. A magnification of 0.5 is 1:2, meaning the image is half life size. A true macro lens reaches 1:1, where the image on the sensor is the same size as the subject.

Does this account for sensor size?

No. It gives the size on the sensor, not the fraction of the frame. Divide the image size by the sensor dimension to see how much of the frame the subject fills.

Sources

Advertisement