Depth of Field (DoF) Calculator screenshot

Depth of Field (DoF) Calculator

Work out the near and far limits of acceptable focus from focal length (mm), f-number, circle of confusion (mm), subject distance (m). H = f² ÷ (N × c) + f; near = H·s ÷ (H + s − f); far = H·s ÷ (H − s + f), and the page prints the substitution so the result can be checked by hand.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Formula printed with the answer

Depth of Field (DoF) Calculator

Work out the near and far limits of acceptable focus from focal length (mm), f-number, circle of confusion (mm), subject distance (m). H = f² ÷ (N × c) + f; near = H·s ÷ (H + s − f); far = H·s ÷ (H − s + f), and the page prints the substitution so the result can be checked by hand.

How this page computes

H = f² ÷ (N × c) + f; near = H·s ÷ (H + s − f); far = H·s ÷ (H − s + f)

0.03 mm is the usual full-frame standard for a print held in the hand. The depth the page prints is the depth for that standard, not an absolute property of the lens.

Focusing at the hyperfocal distance puts the far limit at infinity and the near limit at half of it, which is why the page prints the hyperfocal distance first.

The calculation runs entirely in this browser tab; nothing is uploaded.

Depth of Field (DoF) Calculator computes the near and far limits of acceptable focus. H = f² ÷ (N × c) + f; near = H·s ÷ (H + s − f); far = H·s ÷ (H − s + f). The page prints the rule, the numbers substituted into it and the result, so the arithmetic can be checked by hand.

0.03 mm is the usual full-frame standard for a print held in the hand. The depth the page prints is the depth for that standard, not an absolute property of the lens. Pressed with focal length 50, f-number 1.8, circle of confusion 0.03, subject distance 5, it answers: Hyperfocal distance = 46.346296 m

How to use Depth of Field (DoF) Calculator

Enter focal length 50, f-number 1.8, circle of confusion 0.03, subject distance 5, then press Run: the page evaluates the near and far limits of acceptable focus and prints every line of the working. Typed input is read exactly as written, and a blank field is refused with its name.

Read the first line as the answer and the lines below it as the substitution. If a value is out of range the page refuses it by field and reason instead of printing a number.

With focal length 50, f-number 1.8, circle of confusion 0.03, subject distance 5, the answer is Hyperfocal distance = 46.346296 m.

The circle of confusion is a choice

0.03 mm is the usual full-frame standard for a print held in the hand. The depth the page prints is the depth for that standard, not an absolute property of the lens.

Focusing at the hyperfocal distance puts the far limit at infinity and the near limit at half of it, which is why the page prints the hyperfocal distance first.

What to Expect

Best for

  • Working out the near and far limits of acceptable focus without a spreadsheet
  • Checking a figure someone else quoted
  • Seeing the formula behind an answer

Not ideal for

  • A zero focal length, f-number, circle of confusion or distance is refused.
  • A quantity the page cannot compute, which it refuses instead of estimating
  • Rounding an answer that has an exact form

What this tool keeps

  • H = f² ÷ (N × c) + f; near = H·s ÷ (H + s − f); far = H·s ÷ (H − s + f)
  • Every input exactly as typed

What may need cleanup

  • Nothing: the printed answer is the final output
  • A unit conversion, if the inputs were entered in different units

Common errors

  • A zero focal length, f-number, circle of confusion or distance is refused.
  • An empty field is refused with the field's name

Example use cases

  • Work out the near and far limits of acceptable focus for one set of inputs
  • Check the result against the formula by hand
  • See which input the answer is most sensitive to

Sample input

Depth of Field (DoF) Calculator: focal length 50, f-number 1.8, circle of confusion 0.03, subject distance 5

Sample output

Hyperfocal distance = 46.346296 m — H = f² ÷ (N × c) + f = 50² ÷ (1.8 × 0.03) + 50 = 46346.296296 mm

Who this is for

  • Students checking a formula
  • Anyone who needs the number and the working

Frequently asked questions

What formula does this page use?

H = f² ÷ (N × c) + f; near = H·s ÷ (H + s − f); far = H·s ÷ (H − s + f). The page prints the substitution as well, so the answer can be checked against the rule.

What does Depth of Field (DoF) Calculator refuse?

A zero focal length, f-number, circle of confusion or distance is refused.

What does the default example give?

Focal length 50, f-number 1.8, circle of confusion 0.03, subject distance 5 gives Hyperfocal distance = 46.346296 m. Every line below that restates the same arithmetic.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.