Chris Collins

Tools · photography

Depth of field and lenses

Depth of field with near and far limits, hyperfocal distance and a diagram; circle of confusion by sensor from phones to 4×5; two set-ups side by side; field of view and framing; equivalent focal length, aperture and ISO across formats; megapixels for a print; diffraction against pixel pitch; and macro with extension tubes.

Added

How to use it

Depth of field — pick the sensor or film, focal length, aperture and focus distance. The big line is the zone that looks sharp, from the near to the far limit, drawn to scale (a square-root scale, so a close subject stays readable) with the hyperfocal distance H marked. Focus at H and everything from H/2 to infinity is acceptably sharp. The table shows the same shot at other apertures. Formulas are the thin-lens ones in Wikipedia’s Depth of field article: H = f²/(Nc) + f, near = s(H − f)/(H + s − 2f), far = s(H − f)/(H − s). 50 mm at f/8 with c = 0.03 mm focused at 10 ft gives 7.8 ft to 14.0 ft and H = 34.3 ft, as in the classic DOF tables.

The circle of confusion is how big a blur may be and still look sharp. The standard choice is the sensor diagonal ÷ 1500 (0.029 mm on full frame, 0.019 mm on APS-C, 0.014 mm on Micro Four Thirds) — for an 8 × 10 in print seen at reading distance. Zeiss used ÷ 1730; 2 pixels is for looking at the file at 100%. Sensor presets cover phone sensors (1/2.55″, 1/1.7″, 1/1.3″), 1″, Micro Four Thirds, APS-C (Canon 1.6× and Nikon/Sony/Fuji 1.5×), full frame, 44 × 33 digital medium format, 645, 6×6, 6×7, 6×9 and 4×5 sheet film, or a custom size.

Compare puts two set-ups side by side (A is the one on the first tab): limits, total depth, angle of view, the width covered at the subject, and both diagrams. Make B equivalent to A picks B’s focal length and aperture for the same picture on B’s sensor.

Field of view gives the horizontal, vertical and diagonal angles (50 mm on full frame: 39.6° × 27.0°, 46.8° diagonal), the area covered at the subject distance, a framing sketch, and the focal length or distance that makes a subject of a given width fill the frame.

Equivalence converts focal length, aperture and ISO between formats by the ratio of the diagonals: 25 mm f/1.4 ISO 800 on Micro Four Thirds behaves like 50 mm f/2.8 ISO 3200 on full frame — same angle of view, same depth of field, same total light (and so similar noise). The f-number for exposure does not change.

Print & crop — megapixels needed for a print at a dpi (16 × 12 in at 300 dpi is 4800 × 3600 = 17.3 MP), what is left after cropping, the biggest print you can make, and common paper sizes.

Diffraction — the Airy disk (2.44 λN, λ = 0.55 µm) grows as you stop down; once it covers about two pixels fine detail softens at 100% (on a 24 MP full-frame sensor, 6 µm pixels, from about f/9; on 45 MP from about f/6.5). In a normal print it shows later, when it reaches the circle of confusion. These are rules of thumb: the softening is gradual.

Macro — magnification with extension tubes (extension ÷ focal length, added to the lens’s own), the field covered, the effective aperture N(1 + m), the light lost 2·log₂(1 + m) stops, the close-up depth of field 2Nc(1 + m)/m², and the subject-to-sensor distance. A 50 mm lens with 25 mm of tubes gives 0.5× and loses about 1.2 stops.

Distances are in metres or feet (remembered across the photography tools).

Limits

  • Thin-lens maths: real lenses (especially zooms, macro and internal-focus lenses) differ — marked focal lengths are rounded, focus distances are measured from the sensor plane, and lenses "breathe" as they focus.

  • Depth of field depends on the circle of confusion you choose; it is not a property of the lens alone. Looking at a large print up close, or at 100% on screen, needs a smaller one.

  • Macro figures assume a symmetric lens (pupil magnification 1); telephoto-design macro lenses lose more light.

  • Equivalence by diagonals ignores aspect-ratio differences.

Linking to an example

Share link copies a URL with this tool’s settings (units are not included). Links can be written by hand; add the tab after #: dof, compare, fov, equiv, print, diffraction or macro. Distances are in metres.

Parameter Meaning Example

sensor

phone-small, phone, phone-large, one-inch, mft, apsc-canon, apsc, ff, mf44, 645, 6x6, 6x7, 6x9, 4x5 or custom

sensor=apsc

sw, sh

Custom sensor width and height, mm

sw=30&sh=20

coc

Circle of confusion rule: d1500, zeiss, pixel or custom

coc=zeiss

c

Custom circle of confusion, mm

c=0.02

f

Focal length, mm

f=35

n

Aperture (f-number)

n=2.8

s

Focus or subject distance, m

s=3

mp

Megapixels

mp=45

bsensor, bf, bn, bs

Set-up B on the Compare tab

bsensor=ff&bf=50&bn=1.8&bs=3

w

Subject width, m (Field of view)

w=0.6

to

Format to convert to (Equivalence)

to=ff

iso

ISO (Equivalence)

iso=800

pw, ph

Print width and height, cm

pw=30&ph=20

dpi

Print resolution

dpi=300

keep

Percentage of the width kept when cropping

keep=70

ext

Extension tubes, mm

ext=25

m0

The lens’s own maximum magnification

m0=0.15

example

One of the presets below; parameters given with it override the preset’s

example=portrait-85

Presets:

example= Shows

portrait-85

85 mm f/1.8 on full frame, face at 2 m: about 5.5 cm in focus (open)

landscape-hyperfocal

24 mm f/11 focused at the hyperfocal distance, 1.84 m: sharp from 0.92 m to infinity (open)

phone-vs-ff

A phone main camera (26 mm equivalent, f/1.8) against full frame at the same framing (open)

f18-vs-f4

The same 50 mm lens at f/1.8 and at f/4, subject at 3 m (open)

headshot-framing

A 0.6 m-wide head and shoulders on APS-C from 2.5 m: about 94 mm fills the frame (open)

mft-to-ff

25 mm f/1.4 ISO 800 on Micro Four Thirds = 50 mm f/2.8 ISO 3200 on full frame (open)

print-a3

A 16 × 12 in print at 300 dpi needs 17.3 MP (open)

diffraction-45mp

45 MP full frame: diffraction starts to show around f/6.5 (open)

tubes-50mm

A 50 mm lens with 25 mm of extension tubes: 0.5× and about a stop of light lost (open)

Runs entirely in your browser; nothing you type leaves this page.