Focal Length Calculator
Free focal length calculator. Enter sensor, subject distance and the scene width to fit — or a target angle of view — and get the lens you need in mm.
Focal Length Calculator
Background.
This calculator answers the question every photographer, cinematographer and camera installer actually has when they open a lens catalogue: what focal length do I need? Not what a lens does, but which one to reach for. Tell it the sensor you are shooting, how far away the subject is and how much of the scene has to fit across the frame, and it returns the focal length in millimetres — with the 35 mm equivalent, the magnification on the sensor and the angle of view alongside, so you can check the answer against a specification sheet before you buy or rent anything.
There is a second way in, because half the world specifies lenses in degrees rather than metres. Switch the first dropdown to angle mode, type the horizontal angle of view you need, and the page solves f = w ÷ (2·tan(α/2)) instead. That is the direction to use when a storyboard, a survey specification, a drone mapping plan or a security-camera coverage requirement is quoted as an angle.
The formula matters more than it looks, because almost every published version of it is the approximation rather than the exact relation. Start from the thin lens: for a subject at distance u the transverse magnification is m = f/(u − f), and a sensor w millimetres wide therefore covers a scene width W = w(u − f)/f. Invert that properly and you get f = w·u/(W + w). Drop the "+ w", as most references do, and you get f ≈ w·u/W. At this page's defaults the shortcut is 1.2 % high; at half a metre with a 10 cm subject it is 36 % high, which is the difference between the right lens and the wrong one. This page ships the exact form, and the magnification output is the proof: solved exactly, it comes out at precisely sensor width ÷ scene width, which the approximation never quite manages.
Sensor width is the single most consequential input, and it is why the same shot needs different glass on different bodies. The presets here come from manufacturer specifications rather than folklore — 36 × 24 mm for full frame, 23.5 × 15.7 mm for Nikon DX, 22.3 × 14.8 mm for Canon APS-C, 17.3 × 13.0 mm for Micro Four Thirds and 43.8 × 32.9 mm for Fujifilm GFX. Anything not listed goes in as a custom size, which is also the right route for a phone, a drone or a machine-vision sensor.
The angle of view is reported at infinity focus, which is the convention every lens manufacturer publishes to, so you can compare the number directly against a datasheet. Be aware that at a finite focus distance a lens actually covers a slightly wider angle than its published figure, by the factor (u − f)/u. At the ten metres this page defaults to, that is a little over one percent and safely ignorable. At close-up distances it is not, which is why this page tells you to use the magnification calculator rather than this one once you are into macro territory.
A final caution the arithmetic cannot give you. A focal length is not the same thing as a look. Two lenses that frame identically from different distances produce quite different pictures, because perspective is set by where you stand and not by what is on the front of the camera. If you solve for a 120 mm from ten metres and then decide to shoot a 50 mm from four, the framing will match and the compression will not. The number below is the beginning of the decision, not the end of it.
Below the widget you will find the full derivation, two worked examples computed by hand, why the approximate formula persists, how to convert between formats correctly, and where the thin-lens model stops describing real zooms.
What is focal length calculator?
Focal length is the distance from a lens's rear principal plane to the sensor when the lens is focused at infinity, and it is a fixed property of the glass — it does not change with the camera behind it. What changes with the camera is how much of the lens's image circle gets recorded, and therefore what the same focal length frames. The relation between the two is the thin-lens object-field equation. With f the focal length, u the distance from the front principal plane to the subject, and w the sensor width, the transverse magnification is m = f/(u − f) and the width of scene covered is W = w/m = w(u − f)/f. Solving for f gives the exact framing relation f = w·u/(W + w). The alternative specification is angular: at infinity focus a sensor dimension w subtends α = 2·arctan(w/2f), which inverts to f = w/(2·tan(α/2)). These are the two questions this calculator answers, and they are consistent with each other to within the finite-focus correction (u − f)/u. Everything here is a thin-lens, symmetric-pupil, distortion-free model with distances measured from a principal plane you cannot see. It is accurate to well inside the precision of any real focusing scale at normal subject distances, and it degrades in three known ways: at high magnification, where pupil asymmetry matters; on internally-focusing lenses, whose focal length shortens as they focus closer; and on strongly distorted ultra-wide and fisheye lenses, whose projection is not rectilinear at all and for which the arctan relation simply does not hold.
How to use this calculator.
- Choose how you want to specify the shot. Framing mode is the field workflow — you know the subject and the distance. Angle mode is the specification workflow — a document has told you how many degrees you must cover.
- Pick the sensor format. The width is what drives the calculation, so get it right: Nikon DX and Canon APS-C differ by 1.2 mm, which is a 5 % difference in the focal length you end up with.
- Enter the subject distance in metres. Feet convert at 0.3048, so 30 ft is 9.14 m. This is needed in both modes — in angle mode it is used to report the magnification.
- In framing mode, enter the width of scene that has to fit across the frame. Measure it or pace it: two people side by side is about 1.5 m, a saloon car about 4.5 m, a typical room wall about 4 m.
- In angle mode, enter the horizontal angle of view instead. As anchors on full frame, 50 mm is about 40°, 35 mm about 54°, 24 mm about 74°.
- Read the focal length, then round to a lens that exists. If the answer is 118.6 mm, a 120 mm zoom setting or a 135 mm prime with a step backwards will both work — and the page tells you how far back, because you can re-run it with the new focal length target.
- Check the angle of view against the lens datasheet before you commit. Manufacturers publish angle of view at infinity focus, which is exactly what this output is, so the two numbers should agree to the decimal point.
- Use the 35 mm-equivalent figure to talk to people on other systems, and the magnification figure to sanity-check that you are still in normal photography rather than macro. Once the magnification passes about 0.1 the finite-focus corrections this page ignores start to matter and you want the lens magnification calculator instead.
The formula.
Work in millimetres and convert once at the end.
Start from the thin-lens equation, 1/f = 1/u + 1/v, with u the lens-to-subject distance and v the lens-to-sensor distance. The transverse magnification is m = v/u, and rearranging the thin-lens equation gives v = uf/(u − f), so
m = f / (u − f)
A sensor of width w records an object width W = w/m, hence
W = w (u − f) / f
That is the forward relation: give it a lens and it tells you the coverage. Inverting it for f is where care is needed:
W·f = w·u − w·f f (W + w) = w·u f = w · u / (W + w)
The term almost every reference drops is the + w in the denominator. Dropping it gives f ≈ w·u/W, which is right in the limit where the scene is much wider than the sensor — true for landscapes, false for close-ups. Two numbers show the size of the mistake. At this page's defaults (36 mm sensor, 10 m, 3 m of scene) the exact answer is 118.58 mm and the approximation gives 120 mm, an error of 1.2 %. Move in to half a metre with a 10 cm subject and the exact answer is 132.35 mm while the approximation gives 180 mm — 36 % wrong, and a completely different lens.
There is a neat internal check on getting this right. Substituting the exact f back into m = f/(u − f) gives m = w/W exactly — the magnification must equal sensor width over scene width, because that is what magnification means. Do the same substitution with the approximate f and the identity fails. That is why this page reports the magnification: it is the receipt.
The angular route is independent and simpler. At infinity focus the half-width of the sensor subtends arctan(w/2f) at the rear node, so the full horizontal angle of view is
α = 2 · arctan(w / 2f) and f = w / (2 · tan(α/2))
One consequence worth noticing: α is bounded above by 180° and approaches it only as f approaches zero, so no rectilinear lens can reach or exceed 180° horizontally. Lenses advertised at 180° are fisheyes using a non-rectilinear projection, and the arctan relation does not describe them at all.
The two modes are consistent but not identical, and the page states this rather than hiding it. α is defined at infinity focus; at a finite distance u the lens actually covers a slightly wider angle, in the ratio (u − f)/u. At the defaults that is 98.8 %, an error of just over a percent. At u = 10f it is 90 %. At macro distances it dominates, which is why the honest boundary of this page is around a magnification of 0.1.
Finally, the 35 mm equivalent. It is computed as f multiplied by the crop factor, where crop factor is the ratio of the 35 mm frame diagonal to the sensor diagonal — the definition every manufacturer publishes. Because it is a diagonal ratio while this page frames on the width, formats with a different aspect ratio come out a few percent off: Micro Four Thirds at 4:3 has a width ratio of 36/17.3 = 2.081 against a diagonal crop factor of 1.999, so its equivalent reads about 3 % short. That is a real property of comparing a 4:3 frame with a 3:2 one, not a rounding error, and no single multiplier can remove it.
A worked example.
A full-frame camera, a subject ten metres away, and three metres of scene that has to fit across the frame — a three-person group shot, or a small car, or a shopfront. Working in millimetres: the sensor is 36 mm wide, the distance is 10,000 mm and the scene width is 3000 mm. The exact relation gives f = 36 × 10,000 ÷ (3000 + 36) = 360,000 ÷ 3036 = 118.58 mm. In practice that means a 120 mm setting on a 70–200 zoom, or a 135 mm prime with a metre or so of extra standoff. The magnification comes out at 0.0120 exactly, which is the self-check: it must equal 36 ÷ 3000, and it does, because the exact inversion was used. The approximate formula everyone quotes, f = 36 × 10,000 ÷ 3000, would have given 120.0 mm and a magnification of 0.01215 — close enough here, but the same shortcut at half a metre with a 10 cm subject gives 180 mm against the correct 132.35 mm, a 36 % error. The horizontal angle of view of the solved lens is α = 2·arctan(36 ÷ 237.15) = 17.26°, which you can check straight against any 120 mm lens datasheet. Because the sensor is full frame the 35 mm-equivalent figure is the same 118.58 mm. Now the angle direction. Suppose the brief specifies a 65° horizontal field on a Canon APS-C body, with the subject three metres away — a typical interior or reportage requirement. Then f = 22.3 ÷ (2 × tan(32.5°)) = 22.3 ÷ 1.2741 = 17.50 mm. Multiplying by Canon's 1.6166 crop factor gives a 35 mm-equivalent of 28.29 mm, and 28 mm is indeed the classic 65°-ish reportage wide angle — the sanity check that the whole chain is consistent. The magnification at three metres is 0.00587, comfortably in normal-photography territory. Feed 17.5 mm back through the angle formula and you get exactly 65° again, as you should.
Frequently asked questions.
Why is the answer not simply sensor width × distance ÷ subject width?
Should I use the sensor width, height or diagonal?
Does the answer change if I switch from full frame to APS-C?
How accurate is this for a zoom lens?
Why does the calculator refuse some combinations?
What is the angle of view figure measured at?
Can I use this for a security camera or a drone survey?
Does a longer lens compress perspective?
Where does the 35 mm-equivalent figure come from, and why is it slightly off for Micro Four Thirds?
Is this valid for a fisheye or a very wide lens?
References& sources.
- [1]Nasse, H. H. (2010). 'Depth of Field and Bokeh.' Carl Zeiss Camera Lens Division. Source for the object-side magnification relation M ≈ Dist/f' used to derive the framing formula, and for the principle that focal length is a property of the lens rather than of the sensor behind it: 'we do not talk about an extension of the focal length, it doesn't exist in this case. After all, the lens does not know how much of its image circle we are capturing with our sensor.'
- [2]Canon Inc. EOS R6 Product Manual, Specifications — Image Sensor. Gives the full-frame sensor size as 'Approx. 35.9×23.9 mm', the measured dimension behind the nominal 36 × 24 mm frame used for the full-frame preset.
- [3]Nikon Corporation. D7500 Online Manual, Technical Notes — Specifications. Gives the Nikon DX imaging area as '23.5 × 15.7 mm CMOS sensor' and states that DX lenses are 'equivalent to approx. 1.5×' the 35 mm-format angle of view.
- [4]Canon Inc. EOS R7 Product Manual, Specifications. Gives the Canon APS-C sensor as 'Approx. 22.3 × 14.8 mm' and the angle-of-view conversion as 'Approx. 1.6 times the focal length indicated on the lens' — the 1.2 mm and 5 % difference from Nikon DX that this page's two APS-C presets exist to preserve.
- [5]OM Digital Solutions. OM SYSTEM OM-1 Mark II Specifications. Lists the imaging area as 'Aspect ratio & area 4:3 / 17.3 x 13.0 mm' and, in the stabilisation notes, 'Focal length: 40mm (35mm equivalent: 80mm)' — the exact 2× conversion this page's 35 mm-equivalent output reproduces to within 0.03 %.
- [6]FUJIFILM Corporation. GFX100 II Specifications. Lists the image sensor as '43.8mm×32.9mm', the dimensions used for the medium-format preset — the one case on this page where the required focal length is longer than the full-frame answer.
- [7]FUJIFILM Corporation. FUJINON GF63mmF2.8 R WR Specifications. Lists 'f=63mm (50mm in 35mm format equivalent)', the manufacturer statement validating the sub-1.0 crop factor used in the 35 mm-equivalent output for the GFX preset.
- [8]Ray, S. F. (2002). Applied Photographic Optics: Lenses and Optical Systems for Photography, Film, Video, Electronic and Digital Imaging, 3rd ed. Focal Press. Standard reference for the exact object-field relation W = w(u − f)/f, for the finite-focus correction (u − f)/u to the published infinity-focus angle of view, and for the non-rectilinear projections used by fisheye lenses.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 590 calculators remain free
- No billing is enabled