Lens Focal Length Calculator

Calculate focal length, object distance, or image distance for thin lenses using the fundamental lens equation from optics.

cm
cm

Quick Reference

Thin Lens Equation
1/f = 1/do + 1/di
Fundamental optics formula
Converging Lens
f > 0 (positive)
Convex, brings light together
Diverging Lens
f < 0 (negative)
Concave, spreads light out
Magnification
M = -di/do
Negative = inverted image

Calculation Results

Calculated
Focal Length (f)
-- cm
Distance to focus point
Magnification (M)
--
Size ratio (image/object)
Image Type
--
Real or virtual

Key Takeaways

  • The thin lens equation 1/f = 1/do + 1/di relates focal length to object and image distances
  • Converging (convex) lenses have positive focal lengths and can form real images
  • Diverging (concave) lenses have negative focal lengths and always form virtual images
  • A positive image distance means a real, inverted image on the opposite side of the lens
  • Magnification tells you the size and orientation of the image relative to the object

What Is Focal Length? Understanding Lens Optics

Focal length is the distance from the center of a lens to its focal point, where parallel light rays converge (for converging lenses) or appear to diverge from (for diverging lenses). This fundamental optical property determines how a lens bends light and is crucial in photography, eyeglasses, microscopes, telescopes, and countless other optical instruments.

When light passes through a lens, it bends due to refraction. The amount of bending depends on the curvature of the lens surfaces and the refractive index of the lens material. A lens with a shorter focal length bends light more sharply, creating a wider field of view, while a longer focal length produces greater magnification with a narrower view.

Understanding focal length is essential for anyone working with optical systems, from students learning physics to photographers choosing the right lens, to engineers designing precision instruments. Our lens focal length calculator simplifies these calculations, letting you instantly determine focal length, object distance, or image distance using the thin lens equation.

1/f = 1/do + 1/di
f = Focal length
do = Object distance
di = Image distance

How to Calculate Focal Length (Step-by-Step)

1

Measure the Object Distance

Place your object at a known distance from the lens. Measure from the object to the center of the lens. This is do. For a converging lens, this value is always positive.

2

Measure the Image Distance

Find where the image forms by using a screen or observing where the image appears sharp. Measure from the lens center to the image. Positive di means the image is on the opposite side from the object (real image).

3

Apply the Thin Lens Equation

Calculate: 1/f = 1/do + 1/di. For example, with do = 30 cm and di = 15 cm: 1/f = 1/30 + 1/15 = 1/30 + 2/30 = 3/30 = 1/10. Therefore, f = 10 cm.

4

Calculate Magnification

Find the magnification using M = -di/do. A negative result means the image is inverted. The absolute value gives the size ratio; |M| > 1 means the image is larger than the object.

5

Interpret Your Results

Positive f indicates a converging lens; negative f indicates a diverging lens. Positive di means a real image that can be projected; negative di means a virtual image that cannot be projected onto a screen.

Worked Example: Camera Lens Calculation

Object Distance 100 cm
Image Distance 5.26 cm
Focal Length 5 cm (50mm)

A 50mm camera lens focusing on a subject 1 meter away produces a small, inverted image on the sensor. Magnification = -5.26/100 = -0.053 (image is 5.3% of object size, inverted).

Types of Lenses: Converging vs. Diverging

Lenses are classified into two main categories based on how they bend light rays. Understanding these differences is essential for predicting image formation and choosing the right lens for any application.

Converging (Convex) Lenses

Converging lenses, also called convex lenses, are thicker in the middle than at the edges. They bend parallel light rays inward, causing them to meet at a focal point on the opposite side of the lens. These lenses have a positive focal length and are used in magnifying glasses, cameras, projectors, and corrective lenses for farsightedness (hyperopia).

With converging lenses, the image characteristics depend on where the object is placed relative to the focal point:

  • Object beyond 2f: Real, inverted, diminished image
  • Object at 2f: Real, inverted, same-size image
  • Object between f and 2f: Real, inverted, magnified image
  • Object at f: No image (rays become parallel)
  • Object inside f: Virtual, upright, magnified image

Diverging (Concave) Lenses

Diverging lenses, also called concave lenses, are thinner in the middle than at the edges. They spread parallel light rays outward, making them appear to originate from a focal point on the same side as the incoming light. These lenses have a negative focal length and are used in corrective lenses for nearsightedness (myopia), peepholes, and some optical instruments.

Diverging lenses always produce virtual, upright, and diminished images regardless of object position. This consistent behavior makes them valuable for specific applications where these image characteristics are desired.

Pro Tip: Sign Conventions in Optics

Always use consistent sign conventions. For the standard convention: distances are positive on the side where light exits the lens. Object distances are positive when the object is on the incoming light side. Image distances are positive for real images (opposite side from object) and negative for virtual images (same side as object).

Real-World Applications of Lens Focal Length

Understanding lens focal length has practical applications across many fields. Here are some key examples:

Photography and Cinematography

Camera lenses are specified by their focal length. A 50mm lens on a full-frame camera provides a natural field of view similar to human vision. Wide-angle lenses (14-35mm) capture broader scenes for landscapes and architecture. Telephoto lenses (70-600mm) bring distant subjects closer for wildlife and sports photography. Understanding these relationships helps photographers choose the right lens for each situation.

Eyeglasses and Contact Lenses

Optometrists prescribe lenses measured in diopters, which is the reciprocal of focal length in meters (D = 1/f). A +2.00 diopter lens has a focal length of 0.5 meters (50 cm) and is used for farsightedness. A -3.00 diopter lens has a focal length of -0.33 meters and corrects nearsightedness. This calculator can help you understand your prescription by converting between focal length and diopters.

Microscopes and Telescopes

Optical instruments combine multiple lenses to achieve high magnification. A compound microscope uses an objective lens with a short focal length (4-100x) near the specimen and an eyepiece lens with a longer focal length for comfortable viewing. The total magnification equals the product of both lens magnifications.

Projectors and Displays

Projectors use lenses to create enlarged images on screens. The throw ratio (projection distance / image width) depends on the lens focal length. Short-throw projectors use lenses with shorter focal lengths, allowing large images from close distances, ideal for small rooms or interactive displays.

Common Mistakes to Avoid

  • Forgetting sign conventions: Always keep track of positive and negative values for distances and focal lengths
  • Mixing units: Ensure all distances use the same unit (cm, mm, or m) before calculating
  • Ignoring lens thickness: The thin lens equation assumes lens thickness is negligible compared to distances
  • Confusing focal point and focal length: Focal length is the distance TO the focal point, not the point itself
  • Applying the equation to thick lenses: Complex lens systems require more advanced calculations

Understanding Magnification and Image Formation

Magnification describes the relationship between the size of an image and the size of the object. The linear magnification formula M = -di/do gives both the size ratio and the image orientation:

  • |M| > 1: The image is larger than the object (magnified)
  • |M| < 1: The image is smaller than the object (diminished)
  • |M| = 1: The image is the same size as the object
  • M > 0 (positive): The image is upright (same orientation as object)
  • M < 0 (negative): The image is inverted (upside down)

For example, if an object is 30 cm from a lens and the image forms 60 cm away on the opposite side, the magnification is M = -60/30 = -2. This means the image is twice the size of the object and inverted.

Real vs. Virtual Images

Real images form where light rays actually converge. They can be projected onto a screen and are always inverted. Examples include the image on a camera sensor or a movie projector screen.

Virtual images form where light rays appear to diverge from but do not actually pass through. They cannot be projected onto a screen and can only be seen by looking through the lens. Examples include the image you see in a magnifying glass or the image formed by a flat mirror.

Pro Tip: Quick Image Type Determination

For a quick check: if di is positive, the image is real (can be projected). If di is negative, the image is virtual (cannot be projected). This works with the standard sign convention where positive distances are measured in the direction light travels after leaving the lens.

Advanced Optics Concepts

Optical Power and Diopters

The optical power of a lens is defined as P = 1/f, where f is in meters. Power is measured in diopters (D). A lens with f = 0.5 m has a power of +2 D. This notation is commonly used in optometry because powers can simply be added when lenses are placed in contact: Ptotal = P1 + P2.

Lens Maker's Equation

For those designing lenses, the lensmaker's equation relates focal length to the lens material and curvature:

1/f = (n-1)[1/R1 - 1/R2]

Where n is the refractive index of the lens material, and R1 and R2 are the radii of curvature of the two lens surfaces.

Aberrations and Real-World Limitations

The thin lens equation assumes ideal conditions. In practice, lenses exhibit aberrations:

  • Spherical aberration: Rays through the edge focus differently than central rays
  • Chromatic aberration: Different wavelengths focus at different points
  • Astigmatism: Off-axis rays create distorted images

Modern lens designs use multiple elements and special glass types to minimize these aberrations, which is why quality camera lenses contain many individual lens elements.

Frequently Asked Questions

Use the thin lens equation: 1/f = 1/do + 1/di. Add the reciprocals of the object distance and image distance, then take the reciprocal of the result. For example, with do = 20 cm and di = 30 cm: 1/f = 1/20 + 1/30 = 3/60 + 2/60 = 5/60 = 1/12. Therefore, f = 12 cm.

A negative focal length indicates a diverging (concave) lens. These lenses spread light rays outward instead of converging them. Diverging lenses are used to correct nearsightedness and in various optical instruments. The negative sign is part of the sign convention that helps track light behavior through optical systems.

Diopters (D) = 1 / focal length in meters. For example, a lens with f = 25 cm = 0.25 m has a power of 1/0.25 = +4.0 D. For a diverging lens with f = -50 cm = -0.5 m, the power is 1/(-0.5) = -2.0 D. This conversion is commonly used in eyeglass prescriptions.

A negative image distance means the image is virtual and forms on the same side of the lens as the object. This happens when: (1) using a diverging lens, or (2) placing an object inside the focal point of a converging lens. Virtual images cannot be projected onto a screen but can be seen by looking through the lens, as with a magnifying glass.

Yes, the thin lens equation applies to camera lenses for basic calculations. However, camera lenses are complex systems with multiple elements, so results are approximations. For practical photography, the focal length printed on the lens (e.g., 50mm) tells you the effective focal length of the entire lens system when focused at infinity.

The focal point is the specific location where parallel light rays converge (or appear to diverge from) after passing through a lens. The focal length is the distance from the lens center to this focal point. A lens has two focal points, one on each side, both at the same focal length from the lens center.

Longer focal lengths produce shallower depth of field (more background blur) at the same aperture and framing. This is why portrait photographers often use 85-135mm lenses for pleasing background separation. Wide-angle lenses (shorter focal lengths) provide deeper depth of field, keeping more of the scene in focus.

The thin lens equation assumes lens thickness is negligible compared to focal length and distances. It may not apply accurately for: thick lenses, lenses with large apertures (where aberrations matter), very short focal lengths, or complex multi-element lens systems. For these cases, ray tracing software or the thick lens equations provide more accurate results.