Focal Length Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Enter the distance from the lens to the object and to the sharp image, in millimeters.
Result
Focal length, fmm
Magnification (negative = inverted image)
- Lens power (diopters)
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Object distance, do, in mm: enter 0 or more.
- Image distance, di, in mm: enter 0 or more.
- Read the result: Focal length, f; the panel also shows Magnification (negative = inverted image) and Lens power (diopters).
How this calculator works
Thin lens equation (Gaussian form): 1/f = 1/do + 1/di, so f = do × di / (do + di), for a real object and a real image on the other side of the lens.
Magnification m = −di/do (negative: the image is upside down). Power in diopters = 1/f with f in meters = 1,000 / f (mm).
The formula
| Symbol | Meaning | Unit |
|---|---|---|
| Object distance, do | mm | |
| Image distance, di | mm | |
| Focal length, f | mm |
Worked example
| Object distance, do | 300 mm |
|---|---|
| Image distance, di | 60 mm |
| Magnification (negative = inverted image) | -0.2 |
|---|---|
| Lens power (diopters) | 20 |
Focal length, f 50 mm
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the focal length if the object is 300 mm away and the image forms at 60 mm?
50 mm, with a magnification of −0.2 and a power of 20 diopters.
What happens when the object is very far away?
1/do approaches zero, so the image forms at the focal length: di ≈ f.
When does the image equal the object in size?
When do = di = 2f, the magnification is −1.