---
title: "Depth of Field calculator — AperiOptic"
description: "Near, far and total DoF for a given setup. Free online optics calculator, with the formula and code snippets."
url: "https://aperioptic.com/calculators/depth-of-field"
---

# Depth of Field calculator

Near, far and total DoF for a given setup.

Category: [Imaging](https://aperioptic.com/calculators)

Formula: `H = f²/(N·c)`

## Inputs

| Input | Parameter | Unit | Default |
| --- | --- | --- | --- |
| Focal length | `f` | mm | 50 |
| f-number | `N` |  | 8 |
| Subject dist | `u` | mm | 2000 |
| CoC | `c` | mm | 0.03 |

## Result with the default inputs

- Hyperfocal: 10.4667 m
- Near: 1.6846 m
- Far: 2.4606 m
- Total DoF: 0.776 m

Open it with your own values: put each input in the address as a parameter, for example [`/calculators/depth-of-field?f=50`](https://aperioptic.com/calculators/depth-of-field?f=50). A unit other than the listed one goes in `<parameter>_unit`.

Read more: [Wikipedia: Depth of field](https://en.wikipedia.org/wiki/Depth_of_field)

[All optics calculators](https://aperioptic.com/calculators)

---

The interactive page: https://aperioptic.com/calculators/depth-of-field (AperiOptic runs in the browser; free, no account). Every page of the site as Markdown: https://aperioptic.com/llms.txt
