Lens Selector
Machine Vision Lens Calculator
Tell us your camera, your working distance and the field of view you need. We work out the focal length, check the optics for diffraction and depth of field, and recommend a matching lens from our range that you can view and buy online.
Kept to the sensor aspect ratio. Edit either and the other follows.
Advanced ▼
Recommended lenses
Lenses from our range that fit your setup
Ranked against the focal length your application needs, filtered to your spectral band, with a direct link to each lens.
Varifocal, zoom and telecentric optics ▼
These optics carry a focal range or a fixed measurement geometry rather than a single focal length, so they sit outside the ranking until their full specifications are loaded. Each links straight to its product page.
How it works
Lens selection comes down to three numbers
Get these three right and the focal length follows. The lens also has to cover the full sensor without vignetting and resolve enough detail for the camera's pixels, which is why our engineers confirm the choice in the Insights test lab.
Sensor size
The physical width and height of the camera sensor in millimetres. It follows from the format and the resolution, which is why this calculator works it out for you rather than asking you to type it.
Working distance
The distance from the front of the lens to the object you are inspecting. It is usually fixed by your machine or line layout, which then drives the focal length you need.
Field of view
The area you need the camera to see. Together with sensor size and working distance this sets the focal length, roughly sensor size times working distance divided by field of view.
Understanding lens selection
Lens specifications, explained
The detail behind the numbers, from sensor coverage and resolution through aperture, depth of field and diffraction to mounts, telecentric optics and wavebands. If you would rather talk it through, our engineers are a message away.
How do I choose the right lens for my camera?
Lens choice comes down to three numbers: the sensor size, the working distance and the field of view you need. Together they fix the focal length, which is roughly the sensor size times the working distance divided by the field of view. The lens then has to do two more things, cover the whole sensor without dark corners and resolve enough detail for the camera's pixels. This calculator works all of that out and shortlists a matching lens from our range.
What is sensor format and why does it matter for lens choice?
Sensor format is the optical size of the sensor, quoted in inches such as 2/3 inch or 1.1 inch, or as a diagonal in millimetres. It matters because every lens projects an image circle of a fixed size, and that image circle must be equal to or larger than the sensor, or the corners of the image fall dark, which is called vignetting. One catch worth knowing is that the same inch label can mean slightly different millimetre sizes between sensor makers, so the real width and height in millimetres is what counts, which is why this tool derives them from your resolution and pixel size.
How do I work out the focal length I need?
Focal length sets the angle of view. A shorter focal length gives a wider view and lets the object sit closer, while a longer focal length gives a narrower view with more magnification and suits objects further away. As a guide, the focal length is about the sensor size multiplied by the working distance and divided by the field of view. Enter your working distance and the size of the object and the calculator returns the focal length, then matches it to the nearest lenses we stock.
What does a lens megapixel or resolution rating mean?
A lens has its own resolving power, often quoted as a megapixel rating or a supported pixel size in microns. The lens has to resolve detail down to the size of the camera's pixels, so a lens rated for a low resolution will bottleneck a high resolution sensor no matter how good the camera is. As a rule the lens rating should meet or exceed the sensor, and modern sensors with pixels around 2.74 to 3.45 microns need lenses designed for that level.
How does the aperture or F-number affect the image?
The F-number sets how much light the lens lets in and how much depth of field you get. A wider aperture, meaning a smaller F-number, gathers more light and suits fast lines and short exposures, but gives a shallower depth of field. A smaller aperture, meaning a larger F-number, deepens the focus range but eventually softens the image through diffraction. The calculator shows this trade and warns you when the aperture is stopped down too far for your pixels.
What is the diffraction limit in machine vision?
Closing the aperture down increases depth of field, but past a point the diffraction blur, called the Airy disc, grows larger than a pixel and fine detail is lost. There is therefore a maximum recommended F-number for any sensor and lens combination. The calculator computes it for your setup and flags when your chosen aperture goes beyond it, so you can open up or accept the trade for more depth of field.
What is depth of field and how do I get more of it?
Depth of field is the range of distance, in front of and behind the focus point, that stays acceptably sharp. You get more of it by using a smaller aperture or a shorter focal length, and less of it up close at high magnification. It is always a balance, because a smaller aperture costs light and eventually brings in diffraction, which is why it helps to see all three together as the calculator shows.
Which lens mount do I need?
The mount has to match between the lens and the camera. C-mount is the most common in machine vision, with a flange distance of 17.526mm, and it covers sensors up to around 1.1 inch. CS-mount sits closer to the sensor at 12.5mm and is found on compact cameras. Larger sensors move to F-mount, TFL-mount or M42, which project a bigger image circle. The safest check is your camera's mount and the sensor format together.
When do I need a telecentric lens?
Telecentric lenses hold magnification constant regardless of where the object sits within their range, which removes the perspective error that ordinary lenses introduce. That makes them the right choice for accurate measurement and gauging, where a feature must read the same size wherever it falls in the field. For inspection where you are checking presence, defects or codes rather than precise dimensions, a standard fixed focal length lens is usually the better value.
Should I use a fixed, varifocal or zoom lens?
A fixed focal length lens is set to one focal length and holds it, which gives the most stable and repeatable result on a production line, so it is the usual choice for machine vision. Varifocal and zoom lenses let you adjust the focal length, which helps during setup or where one camera has to cover several product sizes, at some cost to repeatability. For a fixed station the fixed lens is normally preferred.
Does the lens have to match my wavelength, such as SWIR?
Yes. Most machine vision lenses are corrected for visible light and the near infrared, but they do not all behave the same across wavelengths, and focus can shift between visible and infrared. Shortwave infrared, or SWIR, needs lenses specifically corrected for that band, which is why the calculator filters the shortlist by the spectral band you select. If you are imaging outside normal visible light, tell us the waveband and we will confirm the optics.
Want us to confirm the choice?
Send us your samples and we will test the lens on your actual parts in our Insights test lab before you commit. No pressure, no obligation.