Focal Length Calculator
Determine the focal length of a lens using multiple methods: from object and image distances, from magnification, or from field of view and sensor size. A versatile tool for optics design.
Focal length is the most important single number describing a lens. It controls field of view (how wide a scene the lens sees), magnification (how much the object is enlarged or reduced), depth of field (how much of the scene appears in focus), and perspective compression (whether faces look natural or distorted). For a 35mm-format DSLR, a 50mm lens approximates human vision, a 24mm lens captures a wide landscape, and a 200mm lens compresses distant subjects into a flat plane. The same focal length on different sensor sizes gives different effective fields of view (the "crop factor").
This calculator solves the focal length three different ways depending on what you know:
1. **From object and image distances** (thin lens equation): if you can measure where the object is and where the image forms, you can find f. 2. **From magnification and object distance**: for telescopes, microscopes, or magnifying glasses where you know how much enlargement you want. 3. **From field of view and sensor size**: standard photography/cinema problem, "what focal length gives a 60° horizontal angle of view on my full-frame sensor?"
All three are coupled by the thin lens equation and its derivatives. Use this calculator for photography (matching focal length to angle of view), microscopy (designing objectives), telescope design (computing primary/secondary focal lengths), and basic optical bench experiments (verifying a measured lens against its labeled spec).
Inputs
Sensor width or diagonal
Results
Focal Length
166.7 mm
Focal Length
16.67 cm
Optical Power
6.00 D
Focal Length Results
| Parameter | Value |
|---|---|
| Focal Length | 16.6667 cm (166.67 mm) |
| Optical Power | 6.0000 diopters |
| Method | Object/Image Distances |
| Object Distance | 50 cm |
| Image Distance | 25 cm |
| Magnification | 0.5000× |
| Formula | 1/f = 1/do + 1/di |
Formula
How to use this calculator
- Pick the calculation method matching what you know.
- For "from distances": measure object distance from lens and image distance behind lens to focused image.
- For "from magnification": specify the desired magnification (e.g., 0.5× for a wide-angle, 2× for telephoto).
- For "from FOV and sensor": pick whether you mean horizontal, vertical, or diagonal FOV; specify the matching sensor dimension.
- For zoom lenses, the formula gives the focal length at the specific zoom position, not the full range.
- For multi-element lenses, the "effective focal length" measured matches the formula; physical lens length may differ.
Worked examples
Choosing a portrait lens
**Scenario:** You want to shoot a head-and-shoulders portrait that fills a full-frame 36×24mm sensor at 3 meters distance. Subject is roughly 60cm tall (head + upper torso). **Calculation:** Magnification M = 0.024 m sensor / 0.60 m subject = 0.04 (subject is 25× smaller on sensor than in life). Using f = d_o × M / (1 + M): f = 3000 × 0.04 / 1.04 = 115 mm. **Result:** A 115mm focal length puts the subject at proper portrait size at 3 m. The classic "85mm portrait" focal length corresponds to slightly closer distance (~2.2 m). 135mm gives more compressed-perspective look. All three are in the portrait sweet spot — pick based on background you want.
Smartphone lens equivalents
**Scenario:** Your phone has a 26mm equivalent focal length. The actual sensor is 1/2.3" (6.17×4.55mm, diagonal 7.7mm). What's the actual lens focal length? **Calculation:** Crop factor = 43.3 / 7.7 = 5.62. Actual focal length = 26 / 5.62 = 4.6 mm. **Result:** The physical lens has f ≈ 4.6 mm. This is why phone lenses can be so small and compact — short focal length means small image circle. The trade-off: smaller sensors collect less light, leading to higher ISO noise. Modern computational photography (multi-frame stacking, AI denoising) compensates for much of this gap.
Telescope eyepiece magnification
**Scenario:** Your telescope has a 1000mm primary focal length. You use a 25mm eyepiece. What's the magnification? **Calculation:** Telescope magnification = f_primary / f_eyepiece = 1000 / 25 = 40×. **Result:** 40× magnification. To increase, use a shorter eyepiece (10mm → 100×); to decrease, longer eyepiece (50mm → 20×). Maximum useful magnification is bounded by the aperture: about 50× per inch of aperture (so a 4-inch telescope tops out around 200×). Beyond that, atmospheric turbulence and the diffraction limit blur details.
When to use this calculator
**Use focal length math for:**
- **Photography**: matching lens choice to angle of view, planning portrait compression. - **Cinematography**: equivalence between full-frame and other formats, focal-length aesthetics. - **Microscopy**: combining objective and eyepiece magnifications. - **Telescope design**: primary, secondary, and eyepiece focal lengths. - **Surveillance and CCTV**: ensuring the lens captures the desired scene from a given mounting distance. - **Computer vision and machine vision**: choosing a lens for a specific field of view and resolution target. - **Optical bench experiments**: verifying lens specifications, designing simple imaging systems.
**Photography practical guidance:**
- **Crop factor**: APS-C sensors (1.5× or 1.6×) require shorter focal lengths to match full-frame FOV. A "35mm equivalent" 50mm lens on APS-C requires a 33mm physical lens. - **Field of view on smartphones**: even when marketed as "26mm equivalent," the physical lens is much shorter (~4.5mm on 1/2.3" sensors). - **Depth of field shrinks with longer focal length**: at the same f-number and same subject framing, longer focal length = shallower DOF. - **Perspective compression**: longer focal lengths make distant objects look closer to each other (mountains "stacked"). Wider lenses exaggerate near-far distance differences.
**Microscopy practical guidance:**
- **Objective magnification**: standard 4×, 10×, 20×, 40×, 60×, 100× — focal lengths inversely proportional. - **Total magnification** = objective × eyepiece (typically 10× eyepiece). - **Image quality limited by NA**: high-mag objectives need high NA for resolution; oil immersion at 100× reaches NA ≈ 1.4. - **Working distance shrinks with mag**: 4× objective has ~30mm WD; 100× has < 1mm.
**Telescope practical guidance:**
- **Focal ratio f/D**: speed of the telescope. f/4 is "fast" (wide, lots of light); f/15 is "slow" (narrow, planetary detail). - **Magnification = f_telescope / f_eyepiece**: easy to vary by swapping eyepieces. - **Maximum useful magnification**: roughly 50× per inch of aperture due to diffraction and atmospheric seeing. - **Field of view at eyepiece**: depends on both focal length and eyepiece apparent field.
**FOV at different focal lengths on a smartphone (typical 1/2.3" sensor):**
| Equivalent focal length | Actual focal length | Diag FOV | |---|---|---| | 13 mm (ultrawide) | 2.3 mm | 122° | | 26 mm (standard) | 4.6 mm | 79° | | 52 mm (2× zoom) | 9.2 mm | 47° | | 78 mm (3× zoom) | 14 mm | 33° | | 130 mm (5× zoom) | 23 mm | 21° |
Common mistakes to avoid
- Confusing focal length with field of view directly. They're related but inverse: smaller focal length = wider FOV. Sensor size also matters.
- Forgetting sensor size when comparing focal lengths. A "50mm" on full-frame ≠ "50mm" on APS-C in field-of-view terms.
- Using the wrong sensor dimension. Horizontal width gives horizontal FOV; diagonal gives diagonal FOV; vertical gives vertical FOV.
- Mixing focal length with focal ratio (f-number = f/D). Focal length is the lens spec; f-number is the aperture spec.
- Treating a phone's "equivalent" focal length as actual. Marketed equivalent is for FOV comparison; actual lens is much shorter due to smaller sensor.
- Forgetting magnification has a sign for image orientation. M < 0 means inverted real image (camera, projector); M > 0 means upright virtual image (magnifying glass).
- Estimating focal length from physical lens length. Total lens barrel length is longer (telephoto) or shorter (retrofocus) than the optical focal length.
Frequently Asked Questions
Sources & further reading
Related Calculators
Thin Lens Calculator
Calculate image distance, magnification, and image characteristics using the thin lens equation 1/f = 1/do + 1/di.
Lensmaker's Equation Calculator
Calculate focal length and optical power using the Lensmaker's equation: 1/f = (n-1)[1/R1 - 1/R2].
Gaussian Beam Calculator
Calculate Rayleigh range, divergence angle, beam diameter at distance, and depth of focus for a Gaussian beam.