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

Put this calculator on your site

Free embed code. Works anywhere. No signup.

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 thin lenses, and approximately for eyeglass lenses and simple telescope objectives; camera lenses are thick (see Expert Unlock). 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. A gap between calculated and specified focal length points to a measurement error, a thick-lens effect or a manufacturing defect, and is worth investigating.

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. 1/f is the lens's optical power; 1/d₀ and 1/dᵢ describe how strongly the light diverges toward the lens and converges after it.

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

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 15 cm (150 mm). On a full-frame camera that is a telephoto lens, not a wide-angle one.
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. Optical datasheets for some lenses list the principal plane positions alongside the focal length.

Why do some lenses have multiple focal lengths listed?

How do I measure object and image distances accurately?
For a thin lens, measure from the centre of the lens to the object, then from the centre to where the sharp image forms. A camera lens is thick, so its optical centre is not marked on the barrel; the camera body marks the sensor plane with a ⦵ symbol. 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. With a real, thick lens the thin-lens result shifts with object distance, because the lens's principal planes are not at one point and many lenses change focal length slightly as they focus. 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 →