Lens Magnification Calculator - Solve m = h/g From f and d

Use this lens magnification calculator to solve m = h/g from focal length, focus distance, and optional extension tube, with object and image distance outputs.

Updated: June 19, 2026 • Free Tool

Lens Magnification Calculator

Focal length of the converging lens in millimeters. Positive value only; diverging lenses cannot form a real image at the sensor with this setup.

Total distance between the object and the sensor or film, in the unit selected below. Typical camera setups range from 100 mm for macro to over 100 m for telephoto landscape work.

Unit for the focus distance field. Use mm for macro and close-up work, m for landscape and telephoto distances.

Length of any extension tube between the lens and the camera body, in millimeters. Set to 0 if you are not using one. Adds to the lens-to-sensor distance h.

Results

Magnification m
0
Object distance g 0mm
Image distance h 0mm
Effective image distance (with tube) 0mm
Total magnification (with tube) 0
Setup status 0

What Is a Lens Magnification Calculator?

A lens magnification calculator turns a converging lens's focal length and the total distance between the object and the sensor into a numeric magnification m = h/g, plus the object distance g and the image distance h that produce it. Enter f, d, and optionally an extension tube length, and the page returns magnification, object distance, image distance, effective image distance, and total magnification.

  • Pick the right telephoto for distant wildlife or sports: Type in 200 mm, 400 mm, or 600 mm and the distance to the subject to read the magnification before you frame the shot.
  • Plan a macro setup with extension tubes: Enter a 50 mm or 100 mm lens, the close working distance, and a tube length to read the magnification on the sensor.
  • Estimate subject size from a reference object: Use a known-size marker and the focal length to back-solve how big the subject looks relative to the sensor.
  • Compare prime lenses at the same focus distance: Run a 35 mm, 50 mm, and 85 mm prime to see how object distance and magnification move as the focal length grows.

Magnification in photography is almost always less than 1, because the image the lens projects onto a small sensor is much smaller than the subject itself, even with a long telephoto. This calculator works in the camera-lens sense: it computes the size ratio between the image on the sensor and the subject in front of the lens.

If you would rather solve for f, do, or di directly from the thin-lens equation 1/f = 1/do + 1/di, the Thin Lens Equation Calculator page uses the same formula and returns the same magnification as a free output.

How the Lens Magnification Calculator Works

The calculator combines two constraints, the thin-lens equation and the geometric focus-distance constraint, and solves them as a single quadratic in the object distance. The two roots fall out cleanly, and the magnification follows from their ratio.

m = h / g, g = d/2 + sqrt(d^2/4 - f*d), h = d/2 - sqrt(d^2/4 - f*d)
  • f: Focal length of the converging lens, in millimeters. Positive for a converging (real, convex) lens.
  • d: Total focus distance between the object and the sensor, in the same unit as f, typically mm or m.
  • g: Object distance from the object to the lens, in millimeters. The larger of the two roots.
  • h: Image distance from the lens to the sensor, in millimeters. The smaller of the two roots.
  • m: Linear magnification, m = h/g. Equals 1 when g equals h and approaches 0 as g grows much larger than h.
  • e: Optional extension tube length, in millimeters. Adds to h, not to g, so it raises magnification without changing focus distance.

The two equations combine into a single quadratic because the geometry fixes g + h = d at the same time the thin-lens equation fixes 1/g + 1/h = 1/f. The discriminant has to be non-negative, which is why d must be at least 4 times the focal length.

Telephoto shot: f = 500 mm, d = 150 m

f = 500 mm, focus distance = 150 m (150,000 mm), extension tube = 0 mm.

r = sqrt(d^2/4 - f*d) = 74,498.32 mm. g = 149,498.32 mm. h = 501.68 mm. m = 501.68 / 149,498.32 = 0.003356.

m = 0.003356 (about 1/300), g = 149,498.32 mm, h = 501.68 mm.

The image distance h of about 502 mm is just a hair longer than the 500 mm focal length because the subject is much farther than the focal length.

According to Wikipedia, linear magnification of a thin lens is the ratio of the image height to the object height and, by similar triangles, equals the ratio of the image distance h to the object distance g, so m = h/g

When the focal length is not printed on the lens and you need to compute it from the refractive index and the surface radii of curvature, the Lensmakers Equation Calculator page is the right companion tool to run first.

Key Concepts Explained

Four short ideas show up every time you read or measure magnification, and each one feeds directly into the formula the calculator uses.

Linear magnification m = h/g

Linear magnification is the ratio of the image distance h to the object distance g. A 1:1 macro lens projects an image the same size as the subject, so m equals 1; a telephoto at distance produces m much less than 1.

Focus distance d = g + h

The total distance between the object and the sensor is the sum of the object distance and the image distance. Knowing f and d is enough to recover both g and h.

Realizable range d >= 4*f

The discriminant d^2/4 - f*d inside the square root has to stay non-negative for a real answer. At d = 4*f the discriminant is zero and m equals 1. Anything closer is not a real-image setup.

Extension tube adds to h, not to g

An extension tube sits between the lens and the camera body and increases the lens-to-sensor distance h without moving the object. The new magnification is (h + e) / g, so doubling the tube roughly doubles the magnification in the small-h regime.

These four ideas appear together in any optics textbook chapter on real-image formation, but the focus-distance form d = g + h is the one you almost never see written out in introductory treatments.

If the focal length is negative (a diverging lens), the same equations do not give a real image on the sensor, so the calculator explicitly disallows that case. The same real-image quadratic governs curved mirrors, so the Mirror Equation Calculator page is a useful cross-check when you are studying how the lens derivation relates to its mirror analog.

How to Use the Lens Magnification Calculator

Five quick steps turn a lens specification and a working distance into a magnification number, an object distance, and an image distance.

  1. 1 Enter the focal length: Use millimeters. A 50 mm prime, a 200 mm telephoto, and a 100 mm macro all fit the same field, just at different numbers.
  2. 2 Enter the focus distance: Type the distance between the subject and the sensor. For macro use mm, for wildlife and landscape use m.
  3. 3 Pick the focus distance unit: Choose mm for working distance under a meter, m for telephoto setups. The page converts everything to mm internally.
  4. 4 Add the extension tube length if you have one: If you are stacking a 12 mm, 25 mm, or 36 mm tube, enter its length in mm. Leave the field at 0 otherwise.
  5. 5 Read the outputs: The page reports m = h/g as a unitless ratio, g and h in mm, and m' = (h + e)/g when a tube is present.

Suppose you own a 50 mm f/1.8 prime and want to know how big a 25 cm ruler will look at 500 mm subject-to-camera distance. Enter f = 50, d = 500, no tube. The page returns g = 443.65 mm, h = 56.35 mm, m = 0.127.

Once you know the magnification at each scheduled shot, the Time Lapse Calculator page helps you plan the shooting interval and clip length for a time-lapse sequence built around that framing.

Benefits of Using This Calculator

Five concrete benefits show up when you pre-compute magnification instead of guessing it from the back of the camera.

  • Predict the frame size before you shoot: Read the magnification before the shoot, then multiply by the sensor width to know how many millimeters of subject will land on the chip.
  • Compare focal lengths on the same scene: Run a 35 mm, 50 mm, and 85 mm prime at the same focus distance and see how object distance and magnification move.
  • Plan a macro build without buying the wrong tube: Compare m without a tube, with a 12 mm tube, and with a 25 mm tube on the same lens.
  • Verify a telephoto framing plan: Pick the focal length that produces the magnification you want at the distance you expect to shoot from.
  • Catch the unphysical setup early: When d < 4*f the square root goes imaginary and the calculator surfaces a 'Not physically realizable' message instead of returning NaN.

The calculator is also a teaching aid because the formula m = h/g forces you to think in terms of object and image distance rather than focal length alone. For macro work, the 'with tube' column is usually the one that drives the decision.

If the focus distance is given in feet or yards instead of meters and you want to keep the mm/m conversion out of your head, the Distance Converter page handles the unit math for any subject-to-sensor distance.

Factors That Affect Your Results

Four factors shift the magnification more than anything else in the formula, and two limitations of the thin-lens assumption are worth knowing up front.

Focal length of the lens

Longer focal lengths push h toward f and g toward d - f, so m moves toward f/d.

Focus distance to the subject

Halving the focus distance at the same focal length roughly doubles the magnification in the long-distance regime.

Extension tube length

Each millimeter of extension tube adds directly to h without changing g, so m' = (h + e) / g.

Sensor or film size

The magnification formula gives a size ratio, not a frame-filling percentage. The same m on a larger sensor projects a smaller absolute subject size.

  • The formula assumes a thin converging lens in the paraxial limit, so it overestimates h slightly for very short focal length lenses and for very wide aperture lenses, where spherical aberration starts to dominate.
  • The formula does not include diffraction, sensor pixel size, or aperture-induced depth of field. Treat the magnification as a geometric size ratio and read it alongside depth-of-field and diffraction tables.

If you want more magnification, the cheapest geometric move is to halve the focus distance, the next cheapest is to add an extension tube, and the last is to buy a longer lens.

According to the Wikipedia lens (optics) article, when the focal length f and the total focus distance d between object and sensor are known, the object and image distances are recovered from g = d/2 + sqrt(d^2/4 - f*d) and h = d/2 - sqrt(d^2/4 - f*d), and the magnification is m = h/g

Higher-magnification frames produce larger file sizes, so the Upload Time Calculator page is a useful follow-up when you need to estimate how long the resulting RAW or video files will take to push to a backup server.

lens magnification calculator interface with focal length, focus distance, focus unit, extension tube, magnification, object distance, image distance, and total magnification outputs
lens magnification calculator interface with focal length, focus distance, focus unit, extension tube, magnification, object distance, image distance, and total magnification outputs

Frequently Asked Questions

Q: How do you calculate the magnification of a lens?

A: The linear magnification is m = h/g, the ratio of the image distance to the object distance. When only the focal length f and the total focus distance d = g + h are known, g and h are recovered from the quadratic 1/f = 1/g + 1/h combined with g + h = d, giving g = d/2 + sqrt(d^2/4 - f*d) and h = d/2 - sqrt(d^2/4 - f*d). The magnification then reads m = h/g.

Q: What is the magnification of a 50 mm lens at 10 m?

A: For f = 50 mm and d = 10,000 mm the discriminant is 24,500,000, r = 4,949.7 mm, g = 9,949.7 mm, h = 50.25 mm, and m = 0.00505. So a 50 mm lens at 10 meters magnifies the subject by roughly 1/200 of its height on the sensor.

Q: What is the difference between magnification and zoom on a lens?

A: Magnification is the absolute size ratio between the image on the sensor and the subject in front of the lens. Zoom is the relative change in focal length a variable-focal-length lens can produce, like a 18-55 mm kit lens with a 3x zoom. A long telephoto at distance and the same lens at macro distances produce very different magnifications.

Q: How does an extension tube change the magnification of a lens?

A: An extension tube sits between the lens and the camera body and increases the lens-to-sensor distance h by the tube length e. The new magnification is m' = (h + e) / g, where g stays at the value dictated by the focus distance. Doubling the tube roughly doubles the magnification in the small-h regime.

Q: Why is camera lens magnification such a small number?

A: Most camera lenses shoot subjects much farther than the focal length, so g is much larger than h and m = h/g is much smaller than 1. A 50 mm lens at 1 m gives m = 0.056, a 200 mm lens at 10 m gives m = 0.02, and a 600 mm lens at 100 m gives m = 0.006.

Q: Can this calculator be used for a magnifying glass?

A: The same thin-lens relation applies, but a magnifier produces a virtual image at the eye rather than a real image on a sensor. For an angular magnification rating, treat the eye's near point (about 250 mm) as the d value, but for the official 'x' rating of a loupe the standard definition is 250 mm divided by the lens focal length.