Lens Equation Calculator
Solve the thin-lens equation 1/f = 1/u + 1/v to find focal length, object distance, image distance, magnification, and image height. Identify whether the image is real or virtual, upright or inverted, magnified or reduced. Live ray-diagram preview, converging and diverging lenses, and unit support for mm, cm, and m.
Your ad blocker is preventing us from showing ads
MiniWebtool is free because of ads. If this tool helped you, please support us by going Premium (ad‑free + faster tools), or allowlist MiniWebtool.com and reload.
- Allow ads for MiniWebtool.com, then reload
- Or upgrade to Premium (ad‑free)
About Lens Equation Calculator
The Lens Equation Calculator solves the thin-lens equation \(\dfrac{1}{f} = \dfrac{1}{u} + \dfrac{1}{v}\) for any of the three variables — focal length \(f\), object distance \(u\), or image distance \(v\) — and returns the magnification, image height, lens power in diopters, and the full image properties (real or virtual, upright or inverted, magnified or reduced). The live ray diagram on the right shows the three principal rays so you can see at a glance how the lens forms the image.
How to Use This Lens Equation Calculator
- Pick which variable to solve for: image distance v, focal length f, or object distance u. The corresponding input field hides itself — fill in only the two known values.
- Choose Converging for a convex lens (positive focal length) or Diverging for a concave lens (negative focal length). Enter the focal length as a positive number — the calculator handles the sign automatically.
- Pick a length unit (mm, cm, or m) and enter the two known distances. Optionally enter the object height to also get the image height.
- Press Solve lens equation. The result panel shows the unknown distance, magnification, image properties pill row, the full ray diagram, and a step-by-step derivation in LaTeX-rendered math.
- Use the Quick examples chips at the top to load common scenarios (camera lens, projector, magnifying glass, microscope eyepiece, human eye, diverging lens, and the two "solve for f or u" variants).
What Makes This Lens Equation Calculator Different
The Thin-Lens Equation
The thin-lens equation, also called the Gaussian lens formula, relates the focal length of a thin lens to where the image forms for a given object position:
\[ \dfrac{1}{f} \;=\; \dfrac{1}{u} \;+\; \dfrac{1}{v} \]
Here \(f\) is the focal length of the lens, \(u\) is the object distance (always positive in the real-is-positive convention used by this calculator), and \(v\) is the image distance. A positive \(v\) means the image forms on the opposite side of the lens from the object — this is a real image that can be projected on a screen. A negative \(v\) means the image forms on the same side as the object — this is a virtual image that only the eye can see by tracing the rays backward.
Magnification
Linear (lateral) magnification \(m\) is the ratio of image height to object height. The thin-lens model gives it as:
\[ m \;=\; -\,\dfrac{v}{u} \;=\; \dfrac{h_i}{h_o} \]
The minus sign captures orientation: a positive \(m\) means the image is upright (same orientation as the object); a negative \(m\) means the image is inverted (flipped upside down). The absolute value \(|m|\) tells you the size ratio — bigger than 1 means magnified, smaller than 1 means reduced. A camera lens typically gives \(|m| \ll 1\) and a negative \(m\); a magnifying glass gives \(|m| > 1\) and a positive \(m\).
Image-formation Cases for a Converging Lens
| Object position | Image distance | Image nature | Real-world example |
|---|---|---|---|
| u → ∞ (very far) | v ≈ f | Real, inverted, point-like | Camera focusing on a distant landscape |
| u > 2f | f < v < 2f | Real, inverted, reduced | Camera taking a portrait; human eye |
| u = 2f | v = 2f | Real, inverted, same size | Photocopier 1:1 mode |
| f < u < 2f | v > 2f | Real, inverted, magnified | Slide projector or overhead projector |
| u = f | v = ∞ | Image at infinity (parallel rays) | Searchlight or telescope eyepiece collimator |
| u < f | v < 0 (virtual) | Virtual, upright, magnified | Magnifying glass; jeweler's loupe |
Image-formation for a Diverging Lens
A diverging (concave) lens always produces a virtual, upright, reduced image, regardless of where you place the object. The image sits between the object and the lens, and the magnification is always positive and less than 1. This is why peepholes, door viewers, and the front element of a wide-angle camera attachment use diverging optics — they shrink the scene into a smaller upright view.
Lens Power and Diopters
Lens power \(P\) is the reciprocal of focal length when \(f\) is expressed in meters: \(P = 1/f\) with units of diopters (D). A short focal length corresponds to a strong lens with high power. Eyeglass and contact-lens prescriptions are written in diopters: +2 D corrects farsightedness using a converging lens of focal length 0.5 m, while −1 D corrects mild nearsightedness using a diverging lens.
Sign-Convention Reference
This calculator uses the real-is-positive convention common in introductory physics textbooks:
- Object distance u: positive when the object is on the side of the incoming light (the usual case).
- Image distance v: positive for a real image on the opposite side of the lens; negative for a virtual image on the same side as the object.
- Focal length f: positive for a converging (convex) lens; negative for a diverging (concave) lens.
- Magnification m: positive for an upright image; negative for an inverted image.
- Object height \(h_o\): taken positive (above the axis); image height \(h_i\) shares the sign of m.
Frequently Asked Questions
Why does the focal length sometimes get auto-flipped? Many textbooks describe a diverging lens by its magnitude — "a 5 cm diverging lens" — and expect the student to apply the negative sign mentally. To make the calculator forgiving, if you pick the diverging type and enter a positive focal length, the sign is flipped for you. If you enter a negative focal length with the converging type, the calculator stops and asks you to fix the sign because that combination is genuinely contradictory.
What if the calculator says the image is at infinity? The object is sitting exactly at the focal point of the lens. The lens equation gives \(1/v = 1/f - 1/u = 0\), so v is undefined (or infinite). Physically, the outgoing rays are parallel and never converge to form a finite image. Move the object slightly closer to or farther from the lens.
Does this work for mirrors? The same equation form \(1/f = 1/u + 1/v\) applies to spherical mirrors with appropriate sign conventions, but the conventions are slightly different from the lens case. This calculator is built around the lens convention. For mirrors you would need a mirror-equation calculator that uses the mirror-specific signs.
What is the difference between linear and angular magnification? The calculator returns the linear (lateral) magnification \(m = -v/u\), which compares image and object heights for an object of finite size. Angular magnification compares the angle subtended by the image at the eye to the angle subtended by the object — that is the relevant quantity for telescopes and microscopes when comparing visual size, but it depends on viewing distance and is not the same as \(m\).
Reference this content, page, or tool as:
"Lens Equation Calculator" at https://MiniWebtool.com// from MiniWebtool, https://MiniWebtool.com/
by miniwebtool team. Updated: 2026-05-17