ToolNestr

Thin Lens Equation Calculator

Solve 1/f = 1/do + 1/di for focal length, object distance, or image distance, and get the magnification m = -di/do with real/virtual and upright/inverted classification. Two static 3D ray diagrams show a converging lens forming a real image and a magnifying-glass case forming a virtual image, plus charts of image distance and magnification vs object distance.

Reviewed by the ToolNestr Editorial Team — July 2026

Disclaimer: This tool is provided for educational purposes to support learning in physics. It is not a substitute for professional engineering or safety-critical calculations.
Physics
Solve for:
f
do
di
Magnification (m)
Image type

Two ideas that trip students up

Two static, auto-rotating ray diagrams: a converging lens forming a real image, and the same lens acting as a magnifying glass when the object is inside the focal length.

1. Object beyond f — real, inverted image

A converging lens (f = 10 cm) with an object arrow 30 cm away. Rays from the object tip bend through the lens and converge on the far side, forming a real, inverted image at di = 15 cm — matching worked example 1.

2. Object inside f — virtual, upright image (magnifying glass)

The same lens with the object moved to 5 cm — inside the focal length. The rays diverge after the lens and never actually cross; traced backward (dashed), they appear to meet on the SAME side as the object, forming a virtual, upright, magnified image at di = −10 cm — matching worked example 2.

Lens equation graphs

Image distance (di) vs object distance (do), f = 10 cm
Magnification (m) vs object distance (do), f = 10 cm

Both curves have a discontinuity (asymptote) at do = f = 10 cm, where 1/di would require dividing by zero — the image distance and magnification both shoot toward infinity as the object approaches the focal point.

How it works

The core idea in one line: The thin lens equation, 1/f = 1/do + 1/di, links a lens's focal length to how far the object and its image sit from the lens — and where the object lands relative to the focal length decides whether the image is real and inverted, or virtual, upright, and magnified.

1/f = 1/do + 1/di

thin lens equation — f, do, di in the same length units

m = −di / do

magnification — sign shows orientation, magnitude shows size

Rearranged, 1/f = 1/do + 1/di solves any variable: 1/di = 1/f − 1/do, 1/do = 1/f − 1/di, and 1/f = 1/do + 1/di directly gives f. Magnification follows as m = −di/do — its sign shows whether the image is upright (positive) or inverted (negative), and its magnitude shows whether the image is enlarged (|m| > 1) or reduced (|m| < 1) relative to the object.

Worked example 1 — converging lens, object beyond f

Given: An object sits 30 cm from a converging lens with focal length f = 10 cm. Find the image distance and magnification.

Formula: 1/di = 1/f − 1/do
Substitute: 1/di = 1/10 − 1/30 = 3/30 − 1/30 = 2/30
Image distance: di = 30/2 = 15 cm (real image, opposite side)
Magnification: m = −di/do = −15/30 = −0.5

di is positive (real image) and m is negative with magnitude below 1: the image is real, inverted, and reduced to half size.

Worked example 2 — object inside the focal length (magnifying glass)

Given: The same lens (f = 10 cm) now has an object placed just 5 cm away — inside the focal length. Find the image distance and magnification.

Formula: 1/di = 1/f − 1/do
Substitute: 1/di = 1/10 − 1/5 = 1/10 − 2/10 = −1/10
Image distance: di = −10 cm (virtual image, same side as object)
Magnification: m = −di/do = −(−10)/5 = 2

di is negative (virtual image) and m is positive with magnitude above 1: the image is virtual, upright, and magnified 2× — exactly how a magnifying glass works.

Typical focal lengths of common lenses

Approximate values — actual focal length depends on the specific lens design and material.

ApplicationTypical focal length
Reading glasses (mild)+100 cm to +200 cm (weak converging)
Magnifying glass+5 cm to +10 cm (strong converging)
Camera lens (standard)+35 mm to +50 mm
Nearsightedness (myopia) correction−30 cm to −200 cm (diverging)
Projector lens+5 cm to +15 cm

Eyeglass prescriptions are usually quoted in diopters (D = 1/f in meters), not directly in focal length.

Where the thin lens equation actually matters

👓 Eyeglass and contact lens prescriptions

An optometrist measures the focal length needed to correctly focus light onto the retina and prescribes lens power in diopters (D = 1/f, with f in meters). Converging (positive) lenses correct farsightedness; diverging (negative) lenses correct nearsightedness.

📷 Camera and telescope optics

A camera lens forms a real, inverted image on the sensor using the thin lens equation, with di essentially fixed at the sensor distance while the lens moves to bring different do into focus. Telescopes use similar principles with much longer focal lengths to gather and focus light from distant objects.

🔍 Magnifying glasses

Holding an object inside the focal length of a converging lens produces a virtual, upright, magnified image — exactly the case in worked example 2. This is why a magnifying glass has to be held close to what you are inspecting.

🎥 Projector image formation

A projector places the film or digital panel just beyond the focal length so the lens forms a large, real, inverted image on a distant screen; the projector flips the source image upside down internally so the projected picture appears right-side up.

Common misconceptions

"A converging lens always makes a real image."

Only when the object is farther from the lens than the focal length. If the object is placed inside the focal length (do < f), a converging lens produces a virtual, upright, magnified image instead — this is exactly how a magnifying glass is used.

"Negative magnification means the image is smaller."

The sign of m indicates orientation only: negative means inverted, positive means upright. Whether the image is bigger or smaller than the object depends on the magnitude |m|, not the sign — m = −2 is inverted AND twice as large.

"A diverging lens can form a real image."

A diverging (concave) lens with f < 0 always produces a virtual, upright, reduced image no matter where the object is placed, because 1/di = 1/f − 1/do is always negative when f is negative and do is positive.

"The image distance di is just a formality — only the focal length matters."

di tells you where the image actually forms and its sign tells you whether it is real (can be projected on a screen) or virtual (only visible by looking through the lens) — both are needed together with do to know the magnification and image type.

Formula sources & further reading

The formulas here are standard, traceable to:

  • OpenStax, University Physics Volume 3 — §2.3 "Images Formed by Thin Lenses" (free, peer-reviewed). openstax.org
  • Halliday, Resnick & Walker, Fundamentals of Physics — Chapter 34, Images (thin lens equation and sign conventions).
  • Serway & Jewett, Physics for Scientists and Engineers — Chapter 36, Image Formation.

1/f = 1/do + 1/di and m = −di/do, using the standard sign convention: f > 0 converging, f < 0 diverging, di > 0 real image, di < 0 virtual image. Results are rounded for display.

How to use this calculator

1

Choose the unknown

The calculator solves for f, do, or di from the other two.

2

Watch your signs

Enter f as negative for a diverging lens; the calculator reports whether di comes out real or virtual.

3

Check the magnification

The sign shows orientation (upright/inverted) and the magnitude shows size relative to the object.

Related tools

Frequently asked questions

What is the thin lens equation?

1/f = 1/do + 1/di, where f is the focal length of the lens, do is the distance from the lens to the object, and di is the distance from the lens to the image. It assumes a thin lens (negligible thickness) and paraxial rays (close to the optical axis).

What is the sign convention used here?

f is positive for a converging (convex) lens and negative for a diverging (concave) lens. do is positive for a real object in front of the lens. di is positive when the image forms on the opposite side from the object (a real image) and negative when it forms on the same side as the object (a virtual image).

What does a negative image distance mean?

A negative di means the image is virtual: light rays do not actually converge there, but appear to diverge from that point when traced backward. Virtual images form on the same side of the lens as the object and cannot be projected onto a screen — you can only view them by looking through the lens, like with a magnifying glass.

What is the difference between a real and a virtual image?

A real image forms where light rays actually cross and converge; it can be projected onto a screen and is inverted relative to the object. A virtual image forms where rays only appear to diverge from, cannot be projected on a screen, and is upright relative to the object.

What does the magnification value tell you?

Magnification m = -di/do. The sign of m tells you orientation: negative means inverted, positive means upright. The magnitude of m tells you size: |m| > 1 means the image is larger than the object, |m| < 1 means smaller, and |m| = 1 means the same size.

All tool categories

⚛️ Physics (48 tools)
🎚️ Ohm's Law Calculator⚖️ Density Calculator💥 Force Calculator (F=ma)🔋 Parallel Resistor Calculator🔧 Work Calculator (Physics)🏃 Kinetic Energy Calculator📈 Gravitational Potential Energy Calculator🎯 Momentum & Impulse Calculator🎱 Elastic Collision Calculator🧲 Inelastic Collision Calculator〰️ Wavelength Calculator🌍 Newton's Law of Gravitation Calculator🎯 Projectile Motion Calculator⬇️ Free Fall Calculator🔄 Uniform Circular Motion Calculator🥍 Impulse Calculator🔩 Torque Calculator🌪️ Angular Acceleration Calculator🪩 Moment of Inertia Calculator🪀 Centripetal Force Calculator📍 Average Velocity Calculator🚀 Acceleration Calculator🪂 Terminal Velocity Calculator🛰️ Escape Velocity Calculator🪐 Weight on Other Planets Calculator⚙️ Mechanical Efficiency Calculator🛞 Work-Energy Theorem Calculator⛴️ Buoyancy (Archimedes' Principle) Calculator🤿 Pressure Calculator🕰️ Simple Pendulum Period Calculator🌡️ Heat Transfer Calculator⚡ Coulomb's Law Calculator🔌 Series Resistor Calculator💡 Electric Power Calculator🔦 Snell's Law (Refraction) Calculator🔍 Thin Lens Equation Calculator🧯 Specific Heat Calculator🪫 Capacitance Calculator📡 Electric Field Calculator🚨 Doppler Effect Calculator🛸 Orbital Velocity Calculator🌀 Magnetic Force Calculator🎻 Simple Harmonic Motion Calculator🔊 Sound Intensity Calculator📏 Thermal Expansion Calculator🛩️ Bernoulli's Equation Calculator📻 Frequency Calculator🪞 Mirror Equation Calculator
🌐 Networking & IP Tools (36 tools)
🧮 Everyday (26 tools)
💪 Health & Fitness (30 tools)
💰 Finance (34 tools)
🔢 Math (23 tools)
📄 PDF Tools (10 tools)
🎨 Creators (12 tools)
💻 Developers (24 tools)
⚡ Engineering & Science (24 tools)
🧪 Chemistry (50 tools)
🧬 Biology (50 tools)
🏠 Construction & Home Improvement (105 tools)
👗 Clothing & Garment Tools (68 tools)
🍳 Cooking & Baking (9 tools)
🚗 Automotive (26 tools)
🖼️ Image Tools (13 tools)
🔐 Security & Hash (15 tools)
📝 Text Tools (15 tools)
🔍 SEO Tools (11 tools)
🔄 Converters (69 tools)
🕐 Time & Date (15 tools)
📊 Chart Generators (11 tools)
🕌 Islamic Tools (16 tools)