Audited ·Last updated 28 Jul 2026·8 citations·Tier 1·0 uses

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

How do you want to specify the shot?
Sensor format
Only used when the format above is set to Custom. This is the dimension that drives the whole calculation, so take it from your camera's own specification sheet.
mm
Only used when the format above is set to Custom. It affects only the 35 mm-equivalent figure, which is computed from the sensor diagonal.
mm
How far the subject is from the camera, in metres. Required in both directions — in angle mode it is used for the magnification. 1 ft = 0.3048 m.
m
Used in framing mode. The horizontal extent you need to capture at that distance — the width of the building, the two people plus a gap, the length of the car.
m
Used in angle mode. For reference on full frame: a 50 mm covers about 40° horizontally, a 35 mm about 54°, a 24 mm about 74°, and a 14 mm about 104°.
°
Focal length needed
118.5771
The lens the job needs, from the exact relation f = w·u/(W + w) or f = w/(2·tan(α/2)). Real lenses come in fixed steps, so treat this as the target and pick the nearest one you own.
35 mm-equivalent focal length
118.5771 mm
Magnification on the sensor
0.012
Horizontal angle of view
17.2632°

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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°.
  6. 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.
  7. 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.
  8. 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.

f = w · u ⁄ (W + w) · f = w ⁄ (2 · tan(α ⁄ 2)) · m = f ⁄ (u − f) · α = 2 · arctan(w ⁄ 2f)

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.

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.

sensor FormatfullFrame
subject Distance10
scene Width3
custom Sensor Height24
solve Forframing
custom Sensor Width36
target Angle Of View65

Frequently asked questions.

Why is the answer not simply sensor width × distance ÷ subject width?
Because that expression is an approximation that drops a term, and the term it drops is the sensor width itself. The exact inversion of the object-field relation is f = w·u/(W + w), and the shortcut f ≈ w·u/W is only valid when the scene is much wider than the sensor. At the defaults on this page the shortcut is 1.2 % high — 120 mm against the correct 118.58 mm — which nobody would notice. But at close range it collapses: a 10 cm subject at half a metre on full frame needs 132.35 mm, and the shortcut says 180 mm. The magnification output is how you can tell which formula a calculator used, because the exact form always returns exactly sensor width ÷ scene width and the approximation does not.
Should I use the sensor width, height or diagonal?
Width, if you are asking how much has to fit across the frame, which is what this page asks. The relation is per-dimension: whatever sensor dimension you use, the matching scene dimension has to be the one along the same axis. If your constraint is vertical instead — the height of a building, a full-length portrait — enter the sensor height as a custom width and the required vertical extent as the scene width, and the arithmetic is identical. The diagonal is used only for the 35 mm-equivalent output, because that is how crop factor is defined. Mixing axes is the most common way to get a wrong answer from a right formula.
Does the answer change if I switch from full frame to APS-C?
Substantially, and in the direction people often get backwards. A smaller sensor needs a shorter lens for the same framing from the same spot, because the covered width scales with sensor width. The default shot here needs 118.58 mm on full frame, about 77.7 mm on Nikon DX, about 73.8 mm on Canon APS-C and about 57.3 mm on Micro Four Thirds. Note that Nikon DX and Canon APS-C differ by 5 %, which is why this page ships two APS-C presets rather than pretending there is a single one. The 35 mm-equivalent output lets you compare the answers across systems: they all land near 118 mm, differing by a few percent where the aspect ratios differ.
How accurate is this for a zoom lens?
Accurate for the framing, less so for the marking on the barrel. Zoom lenses are notorious for focal length markings that describe the design at infinity focus rather than at the distance you are shooting, and many internally-focusing zooms lose a substantial fraction of their focal length as they focus closer — an effect usually called focus breathing. A 70–200 mm at its closest focus can behave like a 150 mm. The consequence is that the number this page gives you is the focal length you need, not necessarily the number that will be printed on the zoom ring when you achieve it. Frame with your eyes, use this to choose which lens to mount, and expect the ring position to be a little longer than the arithmetic suggests at close distances.
Why does the calculator refuse some combinations?
Because they are not physically photographable. If you ask for a very narrow angle of view with a subject very close — say half a degree with the subject a metre away — the required focal length works out longer than the subject distance itself. A subject closer to the lens than one focal length is inside the front focal point, where no real image is formed at all: the lens can only produce a virtual image, which a sensor cannot record. Rather than return a nonsense number the page stops and explains. The fix is always the same: move back, or accept a wider field.
What is the angle of view figure measured at?
At infinity focus, and horizontally, which are the two conventions lens manufacturers publish to. That means you can take the number this page reports and compare it directly against a lens datasheet without adjusting anything. Be aware of two subtleties. First, at a finite focus distance the real angular coverage is wider than the published figure by the factor (u − f)/u — about 1.2 % at the defaults, negligible for landscape and significant for close-up work. Second, many datasheets quote the diagonal angle of view rather than the horizontal one, because it is a bigger and more flattering number. A 50 mm on full frame is 39.6° horizontally, 27.0° vertically and 46.8° diagonally, and all three describe the same lens.
Can I use this for a security camera or a drone survey?
Yes, and that is exactly what angle mode is for. Coverage specifications in those fields are almost always written either as a required field width at a distance or as a required angle, which are the two inputs here. Enter your camera's sensor dimensions as a custom size — machine-vision and surveillance sensors are usually quoted in the 1/1.8" to 1/2.8" range and their actual millimetre dimensions are on the datasheet, not implied by the fraction. One caution for drone mapping: ground sample distance and coverage also depend on the flying height and the overlap you plan, so this page gives you the lens and the field width, and the survey plan has to do the rest.
Does a longer lens compress perspective?
No — distance does. This is the most persistent misconception in the whole subject, and it matters because it means the number this calculator gives you is not the whole decision. Perspective, meaning the relative size of near and far objects, is set entirely by where the camera stands. If you shoot the same subject from the same spot with a 50 mm and a 120 mm and then enlarge the 50 mm frame to match, the two pictures are identical in perspective. What creates the familiar telephoto compression is that long lenses tempt you to stand further back. So if you solve for a 120 mm at ten metres and then decide to use a 50 mm at four metres instead, you will get the same framing and a visibly different picture. Choose the distance for the look, then use this page to find the lens.
Where does the 35 mm-equivalent figure come from, and why is it slightly off for Micro Four Thirds?
It is the focal length multiplied by the crop factor, and crop factor is defined as the ratio of the 35 mm frame diagonal (43.267 mm) to the sensor diagonal — the definition Nikon, Canon, OM System and Fujifilm all publish to, and which reproduces their stated 1.5×, 1.6×, 2× and 0.79× figures. The wrinkle is that this page frames on the width while crop factor is defined on the diagonal, and those agree only when the two formats share an aspect ratio. Micro Four Thirds is 4:3 against 35 mm's 3:2, so its width ratio is 36 ÷ 17.3 = 2.081 while its diagonal crop factor is 1.999 — a 4 % gap. It is a genuine consequence of comparing differently shaped frames, not an error, and no single number can eliminate it.
Is this valid for a fisheye or a very wide lens?
Not for a fisheye, and with care for a very wide rectilinear lens. Everything here assumes rectilinear projection, in which straight lines in the scene stay straight in the image and the angle relation α = 2·arctan(w/2f) holds. Fisheye lenses use a deliberately different projection — equidistant, equisolid-angle or orthographic depending on the design — which is why a fisheye can reach 180° while the arctan relation says a rectilinear lens never can. Feeding a fisheye's focal length into this page will give you an angle far smaller than the lens actually delivers. Very wide rectilinear lenses are covered by the model but suffer heavy corner stretching and often noticeable residual distortion, so treat answers below about 15 mm on full frame as approximate.

References& sources.

  1. [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. [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. [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. [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. [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. [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. [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. [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
Coming soon