GarfNet DoF Calculator
[skip preamble] Welcome to the latest rework of the GarfNet Depth of Field Calculator. It is based on quite an old JavaScript application that appeared on the web back in the mid 1990s. I rewrote and extended it in the mid 2000’s. Consequently, it was looking rather old and tired. It was also almost impossible to use on a narrow-screen device such as a mobile phone. So this latest incarnation has been rewritten to include “responsive CSS” code, that tries to make it scale and display nicely on such devices.
By default, this JavaScript applet will calculate the near, far and hyperfocal distances in metres. For people who are still not familiar with the metric system, (e.g old people and Americans 🙂 ) you may optionally express distances in feet instead. However this is not fully supported. When using feet for distances, the results are decimalised. In other words, a reading of 6.5 feet is actually 6 feet 6 inches. Anomalies such as this are one of the many reasons why I dislike imperial measures so much, and everything here on GarfNet is all metric.
Focal lengths are all in millimetres. This applet does not attempt to convert focal lengths into inches, thou, cubits, furlongs, rods, poles or perches etc! However, there is a very handy little converter available at https://garfnet.org.uk/converter if you like that sort of thing. But I digress… 🙂
Help
This applet is fairy intuitive and self explanatory. So this is about as close as I have come to producing a help file for it. To calculate the near, far and hyperfocal distance for a particular lens, please enter the four fields marked with an asterisk, namely:
- Focal Length (millimetres),
- Aperture (f stop number),
- Subject’s Distance (metres),
- Camera’s Film or Sensor type.
Then click or tap the Calculate button. To clear the tables click or tap the Reset button. Changing any of the above parameters or the “Film or Sensor Format” also prompts the system to recalculate. This calculator uses the SI metric system by default, but you may optionally tick the “feet” box if you prefer. The three numerical inp boxes also have scroll buttons
There is a sequence of tables further down the screen that shows calculated minimum “Near” and maximum “Far” focal distances for subjects to remain in focus when the lens is focused at 1m, 2m, 4m 8m and 16m away, for your chosen lens at, apertures of f/5.6, f/8, f/11, f/16 and f/32. Frankly I seldom refer to this part, but I know that some users find it helpful. So I left it there for this version.
GarfNet DoF Calculator also supports Dark Reader theming browser plugin. In fact they play rather nicely together, providing you don’t use silly colour combinations. So, that’s it really. It’s quite a fun little applet, once you get the hang of it! 🙂
About
This project borrows heavily from a web application originally developed in 1996 by:-
It was updated and extended using data from:-
And then it was:-
- converted to UTF8.
- metricated – system defaults to metres.
- added extra formats and descriptions.
- recoded to HTML 4.01 Transitional.
- generally tidied up and|or messed up.
- tweaked so that it fits into a WordPress site slightly more elegantly.
- recoded again to HTML5.
- tweaked yet again, so it plays nicely with mobile devices.
- full plain-text changelog. for those who like that sort of thing,
by Garfield Lucas. Version 2.0. build date 2025-09-29. It is an on-going project. All data and functionality is supplied as-is, primarily for my own use and amusement, with absolutely no warranty, express or implied.