ForHosting KIT · Home, food & hobbies

Hyperfocal distance calculator

A 50 mm lens at f/8 with a 0.03 mm circle of confusion has a hyperfocal distance of roughly ten and a half metres: focus there and everything from half that distance to infinity looks sharp. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Focal length
50
Aperture as f-number N
8
Circle of confusion
0.03
You get
Hyperfocal distance
10,466.6666666667
Near limit
5,233.3333333333
Far limit
infinity
Precision
10

This hyperfocal distance calculator turns three photography numbers — lens focal length f, aperture as f-number N, and circle of confusion diameter c — into the hyperfocal distance H and the near focus limit when you focus at H. The standard formulas are fully deterministic: H equals f squared over N times c, plus f, and the near limit is H divided by two, with the far limit at infinity. A classic full-frame check is a fifty millimetre lens at f/8 with a thirty-micron circle of confusion, which yields H of about ten thousand four hundred sixty-seven millimetres and a near limit of half that. Keep f and c in the same length unit so H and the near limit stay consistent; millimetres are the usual choice for both. The engine uses only finite arithmetic with no network calls, no sampling, and no date-dependent shortcuts.

What hyperfocal distance means for your photos

Hyperfocal distance is the focus setting that maximises depth of field for a given focal length, aperture, and acceptable blur circle: when the lens is focused at H, everything from roughly H over two to infinity is acceptably sharp under the chosen circle of confusion. That idea is central to landscape and street work where you want distant scenery and mid-ground detail without hunting for a single subject plane.

Algebraically the common closed form is H equals f squared over N times c, plus f, where f is focal length, N is the dimensionless f-number, and c is the CoC diameter in the same length unit as f. Focusing at H then places the near limit at H over two and the far limit at infinity; this calculator returns those values explicitly so you do not have to re-derive the half-rule by hand.

Where hyperfocal focus fits in field work, teaching, and software

Landscape photographers use hyperfocal settings when they want the far horizon and a mid-ground subject both acceptably sharp without focus stacking. Educators introduce H when teaching depth of field, circle of confusion, and why stopping down or shortening focal length pulls the near limit closer.

App and tool builders call the same contract from scripts to seed deterministic test vectors for DOF helpers, to normalise user-entered lens parameters before showing a focus mark, or to satisfy programming-challenge statements that demand H and the near limit rather than a hand-waved infinity claim. Contest and workshop practice often needs a fast, offline source of millimetre-scale distances so students can mark a focus ring without trusting opaque phone apps that switch CoC defaults silently.

Product and education tools use the rewrite when a learner types focal length, f-stop, and CoC and the UI must show H and H over two with a clear far-limit tag. Pair it with thin-lens or focal-length helpers when you are building a small lab of free, deterministic optics and photography calculators, and keep CoC choices documented so full-frame and crop-sensor defaults stay honest.

Landscape focus planning

Compute H and the near limit for a given lens, f-stop, and CoC so mid-ground to infinity stays acceptably sharp.

Teaching depth of field

Show students how f, N, and c set H and H/2 without opaque apps or non-reproducible spreadsheet macros.

What does the hyperfocal distance calculator cost?

It is free in your browser on this page.

What happens if aperture is zero or negative?

Aperture must be a positive f-number; non-positive values are not valid photographic stops.

Which units should I use?

Outputs share that unit. Aperture is the dimensionless f-number.

Does this tool compute full DOF for any focus distance?

No. It only returns the hyperfocal distance and the near limit when focused at H. Use a full DOF calculator for arbitrary subject distances.

What is the hyperfocal distance of a 50 mm lens at f/8?

With a 0.03 mm circle of confusion it is roughly ten and a half metres. Focus there and everything from about half that distance out to infinity looks acceptably sharp.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/hobby/hyperfocal

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/hobby/hyperfocal \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"focal_length":50,"aperture":8,"circle_of_confusion":0.03}'
{
  "focal_length": 50,
  "aperture": 8,
  "circle_of_confusion": 0.03
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "hobby.hyperfocal",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_abs_value1000000000000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

What hyperfocal distance means and what the response contains

The response echoes the normalised inputs, reports hyperfocal_distance and near_limit rounded to the requested precision, tags far_limit as the string infinity, notes that distance outputs share the length unit of f and c, and includes the method tag hyperfocal_standard plus a short formula reminder. There is no approximate Monte Carlo path and no sensor-size database: the engine either evaluates the closed form inside the supported magnitude range or rejects the input with invalid_input. Rejected cases include missing fields, non-finite values, magnitudes above the documented ceiling, and any non-positive aperture, focal length, or circle of confusion, because those break the physical meaning of f-number and blur diameter.

How focal length, aperture, and CoC are read and stay reproducible

Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces, hex prefixes, and non-numeric tokens are rejected with a clear message so a bad cell does not become a wrong landscape setting. The same positivity rule applies to focal length and circle of confusion so the classic formula stays defined. The preferred fields are focal_length for f, aperture for the f-number N, and circle_of_confusion for the CoC diameter c, but aliases such as f and focal for focal length, N and f_number for aperture, and c, coc, and CoC for the circle of confusion are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Units are not converted: if you enter f and c in millimetres, H and near_limit are millimetres; if you use metres consistently, the outputs are metres. Aperture must be strictly positive: zero or negative f-numbers are rejected with invalid_input because they are not valid photographic stops and would divide by a non-positive product N times c. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for the numeric fields, defaulting to ten and capped at fifteen so JSON goldens stay stable. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the photography formulas yourself.

Where hyperfocal focus fits in field work, teaching, and software

On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.

Deterministic test fixtures

Generate reproducible hyperfocal_distance and near_limit values for unit tests, property checks, and CI assertions.

How are H and the near limit defined?

H = f²/(N·c) + f. When focused at H, near_limit = H/2 and the far limit is infinity under the chosen circle of confusion.

Read the full KIT documentation →