GarfNet DoF Calculator
Skip preamble and launch DoF calculator applet now.
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 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… 🙂
How it works
It calculates hyperfocal distance on a bit of rule-of thumb arithmetic.-
hyperfocal-distance = focal-length2 / (fNumber x circle-of-confusion)
In its calculations we assume that the circle of confusion limit is equal to:-
diagonal of the sensor in millimetres / 1500
Using the DoF Calculator
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:
- Camera’s Film or Sensor type,
- Aperture (f stop number),
- Focal Length (millimetres),
- Subject’s Distance (metres).
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.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.
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/1.4, f/2.0, f/2.8, f/4.0, /5.6, f/8, f/11, f/16, f/22 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. In fact the tables for wider apertures: f/1.4, f/2.0, f/2.8 and f/4.0 are new 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 tweaked, tweaked and tweaked again, so much that hardly any of the original code remains:-
- full plain-text changelog. for those who like that sort of thing,
“GarfNet Depth of Field Calculator” by Garfield Lucas. Version 2.03. build date 2025-10-02. This 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.

Thank you for this simple, clear DoF calculator.
Fortuitous timing of the rework as I review
first images taken with new M43 OM-5 with a 12-60 zoom.
Bookmarked on my mobile for out and about.
Thanks for your comment. It was quite a lot of work and I’m glad you like it.
Nice lens and camera combo too. I hope you have lots of fun with it! 🙂