Focal Length Calculator
Calculate the focal length of a lens using sensor size, angle of view, or object/image distances
Calculation Results
Comprehensive Guide: How to Calculate Focal Length of a Lens
The focal length of a lens is one of the most fundamental properties in optics and photography, determining the lens’s angle of view and magnification capability. Understanding how to calculate focal length enables photographers, engineers, and scientists to make precise optical system designs and achieve desired imaging results.
What is Focal Length?
Focal length (f) is defined as the distance between the optical center of a lens and the image sensor (or film plane) when the lens is focused at infinity. It is typically measured in millimeters (mm) and directly affects:
- Angle of View: Wider focal lengths (e.g., 14mm) capture more of the scene, while longer focal lengths (e.g., 200mm) capture a narrower field.
- Magnification: Longer focal lengths provide higher magnification of distant subjects.
- Depth of Field: Shorter focal lengths generally offer greater depth of field.
f = focal length
v = image distance (distance from lens to sensor)
u = object distance (distance from lens to subject)
Key Methods to Calculate Focal Length
1. Using Sensor Size and Angle of View
This is the most common method in photography, where focal length is derived from the camera’s sensor dimensions and the desired angle of view. The relationship is governed by trigonometry:
θ = horizontal angle of view (in degrees)
Rearranged for angle of view: θ = 2 × arctan(sensor width / (2f))
Example: For a full-frame camera (sensor width = 36mm) with a 50° horizontal angle of view:
| Sensor Format | Sensor Width (mm) | 50mm Lens Angle of View | 24mm Lens Angle of View |
|---|---|---|---|
| Full-Frame (35mm) | 36 | 39.6° | 73.7° |
| APS-C (Canon) | 22.3 | 25.5° | 53.1° |
| Micro Four Thirds | 17.3 | 19.8° | 43.2° |
| 1″ Sensor | 13.2 | 15.2° | 33.4° |
2. Using Object and Image Distances (Lens Formula)
For optical bench calculations, the thin lens formula relates object distance (u), image distance (v), and focal length (f):
f = (u × v) / (u + v)
Example: If an object 1000mm away forms an image 50mm behind the lens:
3. Using Magnification and Object Distance
Magnification (m) is the ratio of image size to object size. The relationship with focal length is:
m = magnification (e.g., 0.1 for 1:10 reproduction ratio)
Example: For an object 500mm away with magnification 0.2 (1:5):
Practical Applications
- Photography: Calculating equivalent focal lengths when switching between crop-sensor and full-frame cameras (e.g., 30mm on APS-C ≈ 45mm on full-frame).
- Microscopy: Determining magnification for microscope objectives where focal lengths are often <1mm.
- Telescopes: Astronomical telescopes use focal length to calculate focal ratio (f-number) and field of view.
- Machine Vision: Industrial lenses require precise focal length calculations to achieve specific working distances and resolutions.
Factors Affecting Focal Length Calculations
- Lens Thickness: The thin lens formula assumes negligible thickness. For thick lenses, the lensmaker’s equation accounts for refractive index and radii of curvature.
- Focus Distance: Focal length is technically defined for infinity focus. At closer distances, the “effective focal length” may vary slightly.
- Lens Distortion: Barrel or pincushion distortion can alter the perceived angle of view, especially in wide-angle or zoom lenses.
- Temperature: Thermal expansion can change the physical dimensions of lens elements, subtly affecting focal length in precision applications.
| Method | Best For | Required Inputs | Accuracy | Complexity |
|---|---|---|---|---|
| Sensor + Angle of View | Photography, cinematography | Sensor width, horizontal AoV | High (for photography) | Low |
| Object/Image Distance | Optical bench testing, microscopy | Object distance, image distance | Very High (theoretical) | Medium |
| Magnification + Object Distance | Macro photography, reproduction ratios | Magnification, object distance | High | Medium |
| Lensmaker’s Equation | Lens design, manufacturing | Radii of curvature, refractive index, thickness | Very High | High |
Advanced Considerations
1. Crop Factor and Equivalent Focal Length
The “crop factor” compares a camera’s sensor size to 35mm full-frame (36×24mm). For example:
- Canon APS-C: 1.6× crop factor → 30mm lens acts like 48mm on full-frame.
- Micro Four Thirds: 2.0× crop factor → 25mm lens acts like 50mm.
2. Hyperfocal Distance
The hyperfocal distance (H) is the focus distance that maximizes depth of field. It relates to focal length (f), f-number (N), and circle of confusion (c):
3. Telephoto and Retrofocus Designs
Modern lenses often use multiple elements to achieve focal lengths that differ from their physical length:
- Telephoto lenses: Physical length < focal length (e.g., 70-200mm zoom).
- Retrofocus lenses: Physical length > focal length (common in wide-angles).
Common Mistakes to Avoid
- Confusing Angle of View: Horizontal, vertical, and diagonal AoV differ. Always specify which dimension you’re using (this calculator uses horizontal).
- Ignoring Units: Mixing mm and inches or degrees and radians will yield incorrect results. Always convert to consistent units.
- Assuming Parfocality: Zoom lenses may not maintain focus when changing focal length (“parfocal”). Re-focus after zooming.
- Neglecting Diffraction: At small apertures (high f-numbers), diffraction limits resolution regardless of focal length.
Tools and Resources
For further study, explore these authoritative resources:
- Carnegie Mellon University: Geometric Optics — Fundamentals of lens theory and ray tracing.
- NIST Optical Radiation Group — Precision optical measurements and standards.
- Edmund Optics Knowledge Center — Practical guides for optical engineers.
Frequently Asked Questions
Q: Why does my 50mm lens behave differently on a crop-sensor camera?
A: The lens’s actual focal length remains 50mm, but the smaller sensor “crops” the image circle, narrowing the field of view. On a 1.5× crop sensor, it behaves like a 75mm lens on full-frame.
Q: Can focal length be negative?
A: Yes, diverging (concave) lenses have negative focal lengths by convention, indicating they spread light rays rather than converging them.
Q: How does focal length affect bokeh?
A: Longer focal lengths compress perspective and enlarge background elements, while wider apertures (enabled by longer lenses) create shallower depth of field—both contribute to pronounced bokeh.
Q: What’s the difference between focal length and focal ratio (f-number)?
A: Focal length is a fixed property (in mm), while focal ratio (f/N) is the ratio of focal length to aperture diameter (e.g., f/2.8). A 50mm f/1.8 lens has a 50mm focal length and a maximum aperture of ~27.8mm (50/1.8).
Conclusion
Mastering focal length calculations empowers you to:
- Select the right lens for your photographic vision.
- Design optical systems with precise imaging properties.
- Troubleshoot focus and magnification issues in microscopy or machine vision.
- Understand the trade-offs between angle of view, magnification, and depth of field.
Use the calculator above to experiment with different scenarios, and refer to the formulas in this guide for manual calculations when needed. For critical applications, always verify results with physical measurements or specialized optical design software.