By Ahsan Khowaja · Updated 27 October 2026
How to use the focal length calculator
The calculator has five modes. The first one is for cameras:
- Pick the sensor size, or choose Custom and type the width and height in millimetres.
- Say whether the subject should fill the frame across its width (a building, a group, a driveway) or its height (a standing person, a doorway).
- Enter the subject size and the distance to it, in metres, feet or centimetres.
You get the length needed, the full-frame lens that gives the same framing, how much room you get on the other side of the frame, and the nearest common prime lens. That makes it a camera focal length calculator for planning a shoot, picking a CCTV lens, or checking whether a lens you own is long enough.
The other modes are for optics homework and lens kits. "Thin lens" finds a focal length from object and image distances. "Where the image forms" goes the other way. "Two lenses together" combines two lenses or a close-up filter. "Zoom ratio" turns a range such as 24–70 mm into a single number.
Focal length formula for framing a subject
A camera works like a pair of similar triangles. The subject and its distance form one, and the sensor and the lens form the other. So:
Focal length = sensor side × distance ÷ subject size
- Sensor side is the sensor width in mm if the subject must fill the width, or the height if it must fill the height.
- Distance and subject size must be in the same unit. Their ratio is all that matters.
Worked examples, the same numbers the calculator is tested against:
- A 4 m wide scene at 10 m, full frame (36 mm wide): 36 × 10 ÷ 4 = 90 mm. The nearest common prime is 85 mm, which is slightly wider, so take a step closer or crop a little. The frame is 2.67 m tall at that distance.
- A 1.8 m person, head to toe, at 6 m, APS-C (about 15.6 mm tall): 15.6 × 6 ÷ 1.8 = 52 mm. On full frame the same framing takes 24 × 6 ÷ 1.8 = 80 mm.
- An 8 m driveway at 12 m, 1/3-inch CCTV sensor (about 4.8 mm wide): 4.8 × 12 ÷ 8 = 7.2 mm. The view is 36.9° wide and 6 m tall at the gate.
The formula assumes the subject is far away compared with the lens, which holds for almost everything except close-up and macro work. Sensor sizes are nominal and vary by a few tenths of a millimetre between models, so treat the result as the lens to look for, not a figure to two decimals.
Focal length calculator by sensor size: lenses to fill the frame at 10 m
How long a lens you need to fill the frame's width with a subject 10 m away, on three common sensor sizes:
| Subject width | Full frame (36 mm) | APS-C (about 23.5 mm) | Micro Four Thirds (about 17.3 mm) |
|---|---|---|---|
| 20 m | 18 mm | 11.75 mm | 8.65 mm |
| 10 m | 36 mm | 23.5 mm | 17.3 mm |
| 5 m | 72 mm | 47 mm | 34.6 mm |
| 4 m | 90 mm | 58.75 mm | 43.25 mm |
| 2 m | 180 mm | 117.5 mm | 86.5 mm |
| 1 m | 360 mm | 235 mm | 173 mm |
For other distances, scale in proportion: at 20 m every lens in the table doubles, and at 5 m it halves. To see what angle a lens covers, use the field of view calculator.
Thin lens equation
In physics, a lens's power links where the object is to where its sharp image forms:
1/f = 1/do + 1/di
- f is the length: positive for a converging (convex) lens, negative for a diverging (concave) one.
- do is the object distance from the lens.
- di is the image distance: positive for a real image on the far side, negative for a virtual image on the same side as the object.
- Magnification is −di ÷ do. A negative value means the image is upside down.
- Lens power in dioptres is 1 ÷ f, with f in metres.
Examples: an object 30 cm from a lens that forms a sharp image 15 cm behind it means 1/f = 1/30 + 1/15 = 3/30, so f = 10 cm (10 dioptres), and the image is half size and inverted. With the same 10 cm lens and an object only 5 cm away, 1/di = 1/10 − 1/5 = −1/10, so di = −10 cm. That is a virtual, upright image twice the size, which is what you see through a magnifying glass.
Some textbooks use a sign convention where distances on the object side are negative, and write the equation as 1/f = 1/v − 1/u. The physics is the same. Only the signs of the inputs change, so use the convention your course uses.
Two lens focal length calculator
Two thin lenses in contact add their powers: 1/f = 1/f1 + 1/f2. Two 100 mm lenses together make a 50 mm lens (10 + 10 = 20 dioptres). When the lenses are a distance d apart:
1/f = 1/f1 + 1/f2 − d ÷ (f1 × f2)
The same two 100 mm lenses 50 mm apart give 1/f = 0.01 + 0.01 − 0.005 = 0.015, so f = 66.67 mm.
Close-up filters are labelled in dioptres. A +1 filter is a 1,000 mm lens, +2 is 500 mm and +4 is 250 mm. A +2 filter on a 100 mm lens gives 1/f = 1/100 + 1/500, so 83.33 mm, which lets the lens focus much closer.
Focal length to zoom calculator
A zoom lens's ratio is its longest focal length divided by its shortest. A 24–70 mm lens is 70 ÷ 24 = 2.92×, and on full frame its view narrows from 73.7° to 28.8° across. A 100–400 mm lens is 4×, so at 400 mm it frames 1/16 of the area it frames at 100 mm, because both the width and the height shrink by four.
Phone cameras label their lenses the same way, as multiples of the main camera's equivalent. If the main camera is about 24 mm equivalent, a "3×" lens is about 72 mm equivalent. The real lengths of phone lenses are only a few millimetres, so compare the equivalents.
Telescope focal length
A telescope's is its aperture times its focal ratio, so a 200 mm f/6 telescope works out at 200 × 6 = 1,200 mm. Put that number into the telescope mode of the field of view calculator with an eyepiece to get magnification and true field, or use it as the lens in camera mode to see what a camera will capture.
How to estimate focal length from an image
The easiest way is to read it. Cameras and phones save it in each photo's EXIF metadata, often with a "35 mm equivalent" figure as well. Our guides to seeing photo metadata and what EXIF data is show where to find it.
If the metadata is gone, measure something of known size and distance in the picture. Say an object 2 m wide, 20 m away, spans 1,000 of the image's 6,000 pixels on a sensor about 23.5 mm wide. On the sensor it is 1,000 ÷ 6,000 × 23.5 = 3.92 mm wide, so the lens was about 3.92 × 20 ÷ 2 = 39 mm.
