Depth of Field Calculator
Free Depth of Field Calculator for creative & design. Free online tool with accurate results using verified formulas.
Calculator
Adjust values & calculateDoF Distribution
Formula
Hyperfocal distance H equals the focal length squared divided by the product of f-number and circle of confusion, plus the focal length. Near and far limits are calculated from H and subject distance. Depth of field is the range between the near and far sharp limits.
Last reviewed: December 2025
Worked Examples
Example 1: Portrait Photography Setup
Example 2: Landscape Hyperfocal Technique
Background & Theory
The Depth of Field Calculator applies the following established principles and formulas. Computers represent all information using binary, a base-2 number system consisting solely of the digits 0 and 1, each called a bit. Because long binary strings are unwieldy, programmers routinely use octal (base 8) and hexadecimal (base 16) as compact shorthand. Converting between bases follows a consistent algorithm: divide the source number repeatedly by the target base, collecting remainders in reverse order. Hexadecimal digits A through F represent the values 10 through 15, allowing a single character to encode four binary bits, making it the preferred notation for memory addresses, color codes, and bytecode. Bitwise operations manipulate individual bits within integers. AND produces a 1 only when both input bits are 1, making it useful for masking. OR produces a 1 when either bit is 1 and is used for combining flags. XOR flips bits that differ, enabling simple toggle logic and efficient swap algorithms. NOT inverts every bit (one's complement), while left and right shifts multiply or divide by powers of two in constant time. Data storage units ascend in binary multiples of 1024: 8 bits form one byte, 1024 bytes form one kibibyte (KiB), 1024 KiB form one mebibyte (MiB), and so forth. Hard-drive manufacturers historically use decimal prefixes (1 KB = 1000 bytes), creating the persistent confusion between binary and decimal interpretations of the same label. The IEC standardized the binary prefixes KiB, MiB, GiB, and TiB in 1998 to resolve this ambiguity. Network bandwidth is measured in bits per second (bps), most commonly megabits per second (Mbps) or gigabits per second (Gbps). A 100 Mbps connection transfers 100 million bits every second, equating to roughly 12.5 megabytes per second. IP subnet masks define network boundaries; CIDR notation appends a prefix length (e.g., /24) to an address, indicating how many leading bits are fixed. A /24 subnet contains 256 addresses with 254 usable hosts. Algorithm efficiency is described using Big-O notation, which characterises the worst-case growth of time or space relative to input size. O(1) is constant, O(log n) is logarithmic (binary search), O(n) is linear, and O(nยฒ) is quadratic. Cryptographic hash functions like SHA-256 produce a fixed 256-bit (32-byte) digest regardless of input length. File compression algorithms exploit statistical redundancy to reduce storage footprint, and compression ratio equals the original file size divided by the compressed size.
History
The history behind the Depth of Field Calculator traces back through the following developments. The conceptual foundation of modern computing traces back to Charles Babbage, whose Analytical Engine design of 1837 introduced the idea of a general-purpose mechanical computer with separate storage and processing units, including what he called the Store and the Mill. Ada Lovelace wrote what many consider the first algorithm intended for machine execution while annotating a translation of Luigi Menabrea's account of Babbage's work, also recognising the machine's potential to manipulate symbols beyond mere numbers. George Boole published "The Laws of Thought" in 1854, formalising a two-valued algebra of logic that would later map perfectly to electrical circuits. It remained largely a mathematical curiosity until Claude Shannon's landmark 1937 master's thesis demonstrated that Boolean algebra could describe switching circuits, laying the theoretical groundwork for all digital electronics. Shannon's 1948 paper "A Mathematical Theory of Communication" defined the bit as the fundamental unit of information and established information theory as a rigorous discipline. The same year, the transistor was invented at Bell Labs by Bardeen, Brattain, and Shockley, eventually replacing vacuum tubes and enabling miniaturisation at scale. ENIAC, completed in 1945, was one of the first general-purpose electronic computers, occupying 1800 square feet and consuming 150 kilowatts of power while performing roughly 5000 additions per second. The ASCII standard was ratified in 1963, assigning 7-bit codes to 128 characters and enabling interoperability between computers from different manufacturers. Through the 1970s, the microprocessor consolidated an entire CPU onto a single chip; Intel's 4004 in 1971 marked the beginning of this trend. The Apple II launched in 1977 and the IBM PC in 1981 brought computing to homes and offices, triggering a mass-market software industry. Tim Berners-Lee proposed the World Wide Web in 1989 and launched the first website in 1991 at CERN, transforming the internet from an academic and military network into a global information infrastructure. Mobile computing accelerated through the 2000s with smartphones integrating powerful processors, wireless networking, and GPS into pocket-sized devices, extending computation into every facet of daily life and cementing TCP/IP as the universal communications fabric.
Frequently Asked Questions
Formula
H = fยฒ/(NรCoC) + f | DoF = Far - Near
Hyperfocal distance H equals the focal length squared divided by the product of f-number and circle of confusion, plus the focal length. Near and far limits are calculated from H and subject distance. Depth of field is the range between the near and far sharp limits.
Worked Examples
Example 1: Portrait Photography Setup
Problem: Calculate DoF for an 85mm lens at f/1.8, focused at 2.5 meters on a full-frame camera.
Solution: f = 85mm, N = 1.8, d = 2500mm, CoC = 0.029mm\nH = (85ยฒ)/(1.8 ร 0.029) + 85 = 138,423mm โ 138.4m\nNear = 2500 ร (138423-85)/(138423+2500-170) = 2455mm โ 2.46m\nFar = 2500 ร (138423-85)/(138423-2500) = 2547mm โ 2.55m\nDoF = 2.55 - 2.46 = 0.09m = 9cm
Result: DoF = 9cm | Near: 2.46m | Far: 2.55m | Very shallow โ perfect for isolating the subject
Example 2: Landscape Hyperfocal Technique
Problem: Find the hyperfocal distance for a 24mm lens at f/11 on full-frame, then calculate the DoF when focused there.
Solution: f = 24mm, N = 11, CoC = 0.029mm\nH = (24ยฒ)/(11 ร 0.029) + 24 = 1829mm โ 1.83m\nFocusing at H = 1.83m:\nNear = 1829 ร (1829-24)/(1829+1829-48) = 915mm โ 0.91m\nFar = infinity (distance = H)\nDoF = infinity
Result: Hyperfocal = 1.83m | Near limit: 0.91m | Far limit: infinity โ everything sharp from ~1m to horizon
Frequently Asked Questions
What is depth of field in photography?
Depth of field (DoF) is the distance range in a photograph where objects appear acceptably sharp. It extends from a near limit in front of the focus point to a far limit behind it. A shallow depth of field means only a thin slice of the scene is sharp, which is popular for portraits where the background is blurred (bokeh). A deep depth of field keeps most of the scene sharp, from foreground to background, which is preferred for landscape photography. Three main factors control DoF: aperture (f-stop), focal length, and subject distance. Understanding depth of field helps photographers make creative decisions about which parts of their image are in focus.
How does aperture affect depth of field?
Aperture has the most direct and intuitive effect on depth of field. A wider aperture (smaller f-number like f/1.4 or f/2) produces a shallower depth of field, meaning less of the scene is in focus. A narrower aperture (larger f-number like f/11 or f/16) produces a deeper depth of field. This happens because a wider aperture allows light rays to enter the lens at steeper angles, causing out-of-focus areas to blur more. However, stopping down too far (beyond f/16 on most lenses) introduces diffraction, which actually reduces overall sharpness. Portrait photographers typically use f/1.4 to f/2.8, while landscape photographers often use f/8 to f/11 for the optimal balance of depth and sharpness.
How does sensor size affect depth of field?
Sensor size indirectly affects depth of field in two ways. First, a smaller sensor has a smaller circle of confusion threshold, which means the standard of sharpness is stricter, resulting in a shallower calculated DoF for the same lens settings. Second, and more importantly, to get the same field of view as a larger sensor, you must use a shorter focal length, which increases DoF, or stand farther back. In practice, full-frame sensors produce shallower depth of field than APS-C or Micro Four Thirds at the same field of view and aperture. This is why smartphone cameras with tiny sensors struggle to produce background blur naturally and often use computational photography to simulate bokeh effects.
How accurate are the results from Depth of Field Calculator?
All calculations use established mathematical formulas and are performed with high-precision arithmetic. Results are accurate to the precision shown. For critical decisions in finance, medicine, or engineering, always verify results with a qualified professional.
Why might my result differ from another tool or reference?
Differences typically arise from rounding conventions, the specific version of a formula (for example, simple vs compound interest), or unit inconsistencies between inputs. Check that both tools are using the same formula variant and the same units. The References section links to the authoritative source behind the formula used here.
Can I use Depth of Field Calculator on a mobile device?
Yes. All calculators on NovaCalculator are fully responsive and work on smartphones, tablets, and desktops. The layout adapts automatically to your screen size.
References
Reviewed by Daniel Agrici, Founder & Lead Developer ยท Editorial policy