Home › Photography & Optics › Hyperfocal Distance Calculator
Hyperfocal Distance Calculator
Computes the hyperfocal distance H = f²/(N·c) + f for a focal length, f-number and sensor circle of confusion, the near limit obtained when focusing at H, and a table of H for the common apertures f/2.8–f/16.
When to use
You want landscape or street settings that keep everything from a near distance to infinity acceptably sharp, or need a focus-distance table for a lens.
Do not use when: You need the sharp zone around an arbitrary focus distance (use depth-of-field), or you want the framing of the lens (use field-of-view).
Formula
H = f² / (N·c) + f (f = focal_length_mm, N = aperture_f, c = coc_mm; result in mm ÷ 1000); near limit = H / 2
Uses the exact definition with the '+ f' term; the common approximation H ≈ f²/(N·c) differs by one focal length. Presets use the diagonal/1500 circle of confusion convention.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
focal_length_mm | number | mm | yes | Actual (not equivalent) focal length of the lens in millimetres. Range: ≥ 1, ≤ 5000 |
aperture_f | number | yes | Lens f-number, e.g. 2.8 for f/2.8. Range: ≥ 0.5, ≤ 128 | |
sensor | enum: full_frame | aps_c | aps_c_canon | micro_four_thirds | one_inch | medium_format_44x33 | smartphone_1_over_2_3 | default full_frame | Sensor format; selects the circle of confusion used in the formula. | |
coc_mm | number | mm | no | Optional acceptable circle-of-confusion diameter; overrides the preset value (full frame 0.030, APS-C 0.020, Micro Four Thirds 0.015, 1-inch 0.011 mm). Range: > 0, ≤ 1 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
hyperfocal_m | number | m | Focus here for sharpness from H/2 to infinity. |
hyperfocal_ft | number | ft | Hyperfocal distance in feet (1 ft = 0.3048 m). |
near_limit_when_focused_at_hyperfocal_m | number | m | H / 2: closest acceptably sharp distance when focusing at the hyperfocal distance. |
coc_used_mm | number | mm | Circle of confusion diameter applied (preset or override). |
table | object | m | Hyperfocal distance in metres for f/2.8, f/4, f/5.6, f/8, f/11 and f/16 with the same focal length and sensor. |
Example
24 mm, f/8, full frame: {"focal_length_mm":24,"aperture_f":8,"sensor":"full_frame"} → {"hyperfocal_m":2.424,"hyperfocal_ft":7.95,"near_limit_when_focused_at_hyperfocal_m":1.212,"coc_used_mm":0.03}
35 mm, f/11, APS-C: {"focal_length_mm":35,"aperture_f":11,"sensor":"aps_c"} → {"hyperfocal_m":5.603,"near_limit_when_focused_at_hyperfocal_m":2.802,"coc_used_mm":0.02}
GET https://tttkmbb.com/api/v1/calculate/hyperfocal-distance?focal_length_mm=24&aperture_f=8&sensor=full_frame
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/hyperfocal-distance(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/hyperfocal-distance · Markdown: https://tttkmbb.com/photography/hyperfocal-distance.md · JSON definition: https://tttkmbb.com/photography/hyperfocal-distance.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="hyperfocal-distance" - OpenAPI operationId:
calculate_hyperfocal_distance - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Hyperfocal distance (reference)
- Wikipedia – Circle of confusion (reference)
- Cambridge in Colour – Hyperfocal distance (reference)
FAQ
Should I focus exactly at the hyperfocal distance?
Focusing slightly beyond H keeps infinity comfortably sharp at the cost of a little near-side depth; focusing short of H makes infinity soft. Lens distance scales are coarse, so err towards the far side.
Does the crop factor change the hyperfocal distance?
Only through the circle of confusion: for the same actual focal length and f-number, an APS-C sensor (c = 0.020 mm) has a hyperfocal distance about 1.5× longer than full frame (c = 0.030 mm).
Related calculators
- Depth of Field Calculator — Near and far limits for any focus distance, not only the hyperfocal one.
- Crop Factor Calculator — Sensor diagonal and crop factor behind the circle of confusion presets.