Selection calculator
Lens focal length calculator for machine vision cameras
Magnification is sensor width divided by field-of-view width. Focal length ≈ working distance × magnification ÷ (1 + magnification). Pick the nearest standard lens and check the field of view it really gives.
Worked example
A 2448 px camera with 3.45 µm pixels has a 8.45 mm wide sensor. For a 100 mm field of view at 300 mm the focal length is about 23.4 mm: a 25 mm lens gives 92.9 mm and a 16 mm lens gives 149.9 mm.
How the calculation works
- Sensor width = horizontal pixels × pixel size
- Magnification = sensor width ÷ field-of-view width
- Focal length ≈ working distance × magnification ÷ (1 + magnification)
Before you choose a model
- This is a thin-lens estimate measured from the object to the lens. Check the lens minimum object distance and mounting space; short distances may need extension rings or a macro lens.
- The lens image circle must cover the sensor, and its resolution must suit the pixel size.
Other calculators
Selection calculator
Check the result against your samples
Send the numbers with sample images, working distance and line speed. Deyi Vision engineers confirm the camera, lens and lighting before any quotation.
Send for reviewSelection calculator
Questions about this calculation
How do I calculate the focal length of a machine vision lens?
Divide sensor width by field-of-view width to get magnification, then focal length ≈ working distance × magnification ÷ (1 + magnification). Choose the nearest standard lens and confirm the real field of view.
What happens if I choose a shorter focal length?
At the same working distance a shorter lens gives a wider field of view, so each pixel covers more of the part. Check that the smallest feature still has enough pixels.