Focal Length Calculator

What is the focal length of your lens setup?

Enter your object distance and image distance to calculate the focal length of a lens. Perfect for optics experiments, camera lens analysis, and physics coursework.

Updated June 2026 · How this works

Worth knowing
How It Works
The formula, explained simply

The focal length calculator uses the fundamental thin lens equation from optics: 1/f = 1/d₀ + 1/dᵢ, where f is focal length, d₀ is object distance, and dᵢ is image distance.

When light from an object passes through a converging lens, it bends to form an image at a specific distance. The focal length represents the lens's ability to bend light - shorter focal lengths bend light more sharply, creating wider fields of view, while longer focal lengths provide greater magnification of distant objects.

This relationship holds for all thin lenses, from camera lenses to eyeglasses to telescope objectives. By measuring where an object is placed and where its sharp image forms, you can determine the lens's focal length regardless of its physical markings or specifications.

The calculation assumes a thin lens (thickness negligible compared to focal length) and paraxial rays (light rays close to the optical axis). For thick lenses or wide-angle applications, more complex formulas account for lens geometry and aberrations.

When To Use This
Right tool, right situation

Use this calculator when designing optical systems, testing unknown lenses, or conducting physics experiments. It's essential for determining if a lens meets specifications without relying on manufacturer markings.

Photographers use focal length calculations to understand lens behavior at different focusing distances, especially for macro work where specifications become less reliable. The calculator helps predict image size and working distance for specific magnifications.

In educational settings, measuring focal length demonstrates fundamental optics principles. Students can verify theoretical predictions against experimental results, reinforcing the connection between mathematics and physical phenomena.

Optical technicians use these calculations for quality control, ensuring manufactured lenses meet design specifications. Any deviation between calculated and specified focal length indicates manufacturing defects or measurement errors requiring investigation.

Common Mistakes
Why results sometimes look wrong

The most common error is measuring distances from the wrong reference point. Always measure from the optical center of the lens, not from the lens surface or mount. Many beginners measure from the front or back of the lens assembly, leading to significant errors.

Another frequent mistake is using different units for object and image distances. If you measure object distance in centimeters, image distance must also be in centimeters. Mixed units produce meaningless results.

Failing to achieve sharp focus when measuring image distance leads to inaccurate focal length calculations. The image must be crisp and clear at the measurement point. Blurry images indicate incorrect distance measurement.

Assuming the calculated focal length equals the lens specification is wrong for close-up work. Lens specifications assume infinite object distance, while your measurements use finite distances, creating apparent discrepancies.

The Math
Worked examples and deeper derivation

The thin lens equation 1/f = 1/d₀ + 1/dᵢ derives from Snell's law and geometric optics principles. Each term represents the optical power of different parts of the system.

Rearranging the equation gives f = (d₀ × dᵢ)/(d₀ + dᵢ), which shows that focal length is the harmonic mean of object and image distances. This explains why focal length is always smaller than either distance individually.

When object distance approaches infinity (d₀ → ∞), the equation simplifies to f = dᵢ, meaning the image forms exactly at the focal point. This is how lens manufacturers specify focal length - the distance where parallel light rays converge.

For diverging lenses, image distance becomes negative (virtual image), resulting in negative focal length. The mathematics remain valid, but the physical interpretation changes to describe light divergence rather than convergence.

Photography lens test
Object at 60cm, image forms at 20cm
The focal length is 15cm, indicating a wide-angle lens suitable for landscape photography.
Physics lab experiment
Light source at 30cm, screen at 15cm from lens
The focal length is 10cm, typical for basic optics demonstrations in educational settings.
Microscope objective
Sample at 5mm, image at 160mm
The focal length is 4.85mm, consistent with high-magnification microscope objectives.
Expert Unlock
The thing most explanations skip

The thin lens equation assumes the lens thickness is negligible compared to focal length, but real lenses have finite thickness. For thick lenses, principal planes shift from the geometric center, requiring corrections to the basic formula. High-quality camera lenses often specify principal plane locations separately from focal length.

Why do some lenses have multiple focal lengths listed?

How do I measure object and image distances accurately?
Measure from the optical center of the lens (usually marked on the lens barrel) to the object, then from the optical center to where the sharp image forms. Use the same units for both measurements and ensure the image is properly focused.
What does a negative focal length result mean?
Negative focal length indicates a diverging lens (concave) rather than a converging lens (convex). The thin lens equation still applies, but diverging lenses spread light outward rather than focusing it to a point.
Why doesn't my calculated focal length match the lens specification?
Lens specifications often assume infinite object distance. Your calculated focal length varies with object distance due to lens thickness and aberrations. For precise measurements, use objects at least 10 times the focal length away.

Need something this doesn't cover?

Suggest a tool — we'll build it →