Optics Focal Length Calculator
Toggle between Single Lens (📏) and Lens Combination (🔭) modes. Enter your values in consistent units (mm, cm, m). Leave exactly one input blank in the active mode and click Solve — the calculator will compute the missing value and show step-by-step derivation if requested.
Focal Length in Optics — single-lens imaging, lens combinations, sign conventions and practical guidance
Focal length is a central parameter in geometrical optics describing how a lens converges or diverges light. It determines magnification, field of view and imaging geometry for cameras, microscopes, telescopes and other optical systems. This page provides both the classic thin-lens imaging formula and the effective focal length for lens combinations, with derivations, worked examples, measurement techniques and practical tips for laboratory and design work.
Thin-lens imaging formula
The thin-lens (paraxial) imaging relation links object distance u, image distance v, and focal length f:
1 / f = 1 / u + 1 / v
This relation assumes the lens is thin (thickness negligible) and rays are paraxial (close to the optical axis, small angles). Under these conditions, simple ray diagrams using two principal rays (a ray through the center that is undeviated and a ray parallel to the axis that refracts through the focal point) produce the imaging equation above.
Interpreting u, v and f
Carefully follow a consistent sign convention. A commonly used convention (Cartesian, left-to-right) is:
- Distances measured to the right are positive; to the left are negative.
- Real objects (left of lens) often have positive u; real images (right of lens) have positive v.
- Converging lenses have positive focal length (f > 0); diverging lenses have negative focal length (f < 0).
Different textbooks use slightly different sign conventions—always be consistent. This calculator accepts signed numbers; leave exactly one field blank and it will compute the missing signed value.
Solving the thin-lens equation
Algebraic rearrangements allow solving for any unknown:
- f: f = 1 / (1/u + 1/v)
- v: v = 1 / (1/f − 1/u) — watch for division by zero when 1/f = 1/u
- u: u = 1 / (1/f − 1/v)
Worked examples — single lens
Example 1 — camera focusing: Object at u = 1000 mm, image forms at v = 50 mm. Then 1/f = 1/1000 + 1/50 = 0.001 + 0.02 = 0.021 ⇒ f ≈ 47.619 mm.
Example 2 — virtual image with diverging lens: f = −100 mm (concave), object at u = 200 mm ⇒ 1/v = 1/f − 1/u = −0.01 − 0.005 = −0.015 ⇒ v = −66.667 mm (negative v indicates virtual image on object side).
Lens combination — effective focal length
For two thin lenses separated by distance d, the effective focal length F is given by:
1 / F = 1 / f₁ + 1 / f₂ − d / (f₁ · f₂)
This expression accounts for the relative separation of the two lenses: when they are in contact (d = 0), it reduces to 1/F = 1/f₁ + 1/f₂. As d increases, the combined optical power changes and F can increase or even become infinite for certain configurations (collimated output).
Derivation sketch for lens combination
Consider lens 1 forming an intermediate image; treat that intermediate image as an object for lens 2 after accounting for separation d. Using the thin-lens equation twice and eliminating the intermediate distance yields the compact formula above. The derivation assumes thin lenses and paraxial rays; thickness and principal plane shifts are neglected.
Worked examples — combination
Example 3 — telescope spacing: f₁ = 200 mm (objective), f₂ = 50 mm (eyepiece), d = 250 mm ⇒ 1/F = 1/200 + 1/50 − 250/(200×50) = 0.005 + 0.02 − 0.025 = 0 ⇒ F = ∞ (collimated output). This condition (d = f₁ + f₂) gives collimated light — used in simple telescopes.
Example 4 — two positive lenses: f₁ = 100 mm, f₂ = 100 mm, d = 20 mm ⇒ 1/F = 0.01 + 0.01 − 20/10000 = 0.02 − 0.002 = 0.018 ⇒ F ≈ 55.555 mm.
Solving for f₁ or f₂
You can rearrange the combination formula to solve for f₁ (or f₂) when the other variables are known. Algebraically:
Starting with: 1/F = 1/f₁ + 1/f₂ − d/(f₁ f₂). Multiply through by f₁f₂ and rearrange to isolate f₁ (or f₂). The solved forms are:
f₁ = (f₂ − d) / (f₂ / F − 1) (requires F, f₂, d)
f₂ = (f₁ − d) / (f₁ / F − 1) (requires F, f₁, d)
Care: denominators can vanish (division by zero) for specific combinations — the calculator checks and warns when the algebraic denominator is too small.
Practical measurement techniques
Direct bench measurement: Place an illuminated object and a screen on an optical bench. Move the screen until a sharp image appears, measure u and v from the lens plane, and compute f. For more precise results measure multiple u/v pairs and average results.
Infinity focus: For many camera lenses you can focus on a distant object (effectively u → ∞) and measure the lens-to-sensor distance — that distance is approximately the focal length for thin-lens approximations.
Limitations & when to use advanced models
The thin-lens and two-lens combination formulas are ideal for quick design checks, lab exercises, and educational purposes. For production optical systems or high-precision design consider:
- Thick-lens analysis (principal planes and lens thickness matters).
- Ray-tracing with real glass dispersion (wavelength dependence) and aspheric surfaces.
- Aberration analysis (spherical, coma, astigmatism, field curvature) for image quality.
Common pitfalls
- Mixing units — always use consistent units across u, v, f, d, f₁, f₂.
- Sign confusion — apply one sign convention and stick to it for all inputs.
- Expect deviations if the lens is thick, aperture is large, or rays are far off-axis.
Summary
This calculator provides a practical, flexible tool for computing focal lengths in common optics tasks: compute any missing variable for a single thin lens or analyze two-lens combinations including spacing effects. Use it for labs, quick optical checks, and classroom problems; for production or high-precision optical design use specialized tools and ray-tracing software.
Frequently Asked Questions
Use Cartesian (left-to-right) by default: distances to right positive. Enter signed numbers consistently. The calculator treats inputs as signed values and computes the missing signed result.
Yes — negative focal length represents a diverging lens. Enter negative values when appropriate.
Use consistent units (mm, cm, m) across all inputs. Results are returned in the same unit as your inputs.
No — these are thin-lens formulas. For thickness effects use thick-lens formulas or ray-tracing software.
Paraxial thin-lens predictions are accurate near the axis and for small angles. Off-axis aberrations and manufacturing tolerances are not included.
Use an optical bench: measure u and v for a sharp image and apply the thin-lens formula. For distant objects (u→∞) measure lens-to-sensor distance to approximate f.
When 1/f₁ + 1/f₂ = d/(f₁·f₂), the combined system produces collimated output (F → ∞). This describes spacing equal to f₁ + f₂ in certain telescope configurations.
This page supports two-lens combinations. For N-element systems use matrix optics or ray-tracing tools.
Yes — use the Download CSV button to export computed values and step derivations for lab notebooks.
Yes — AkCalculators provides this educational tool free for students and engineers.