ForHosting KIT · Home, food & hobbies

Depth of field from magnification

At life size, f/8 and a 0.03 mm circle of confusion, total depth of field is only 0.96 mm: enter magnification, aperture and circle of confusion to plan close-ups and focus stacks without measuring distance. 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
Magnification
1
Aperture
8
Circle of confusion mm
0.03
You get
Pupil factor
1 mm
Total dof mm
0.96
Half dof mm
0.48
Effective f number
16

Close-up and macro photographers rarely think in subject distance the way landscape shooters do. Once you know the reproduction ratio—one-to-one life size, one-to-two, two-to-one—the total depth of field is fixed by a simple closed form in magnification, f-number, and circle of confusion. This depth of field from magnification calculator accepts that triad, optionally a pupil factor for asymmetric lenses, and returns total DOF in millimetres plus a symmetric half-DOF split and the effective working f-number used in macro exposure notes. No network, no model tokens, and no random seeds—only deterministic floating-point arithmetic that matches textbook macro DOF tables.

Why magnification fixes total DOF in close-up work

In general photography the classic depth-of-field formulas need focal length, focus distance, aperture, and circle of confusion, then route through the hyperfocal distance to produce near and far limits. At high magnification those distance-based inputs become awkward: working distance changes with every extension tube or bellows rack, and the number you actually dial on a dedicated macro lens is the reproduction ratio marked on the barrel.

The standard thin-lens derivation collapses total depth of field into a compact expression DOF equals two times N times c times open parenthesis m plus p close parenthesis, all divided by m squared. Here m is the absolute linear magnification image size over object size on the sensor, N is the marked f-number, c is the circle of confusion diameter in the same length unit you want for the answer, and p is the pupil magnification ratio of exit pupil to entrance pupil.

For symmetrical or near-symmetrical designs p is taken as one, which recovers the familiar form two N c times one plus m over m squared. Because DOF scales as one over m squared, doubling magnification from one-to-one to two-to-one quarters the total sharp zone at the same stop and CoC—exactly the intuition every insect shooter learns the hard way. This capability evaluates that closed form only.

It does not solve the full near and far limits from subject distance, does not compute hyperfocal distance, does not convert crop factor into CoC for you, and does not model diffraction or focus-stacking frame counts. Those are separate search intents and landings.

Where a magnification-based DOF calculator earns its keep

Insect, jewelry, and product macro shooters plan apertures before they set the tripod: they already know they will shoot at one-to-one or two-to-one and need the total sharp slab in millimetres to decide whether one frame is enough or a focus stack is required. Teachers and club mentors assign endless problems that ask for total DOF at a listed reproduction ratio and f-stop with a stated CoC; a single trusted oracle speeds grading and demo setup.

Content sites that rank for depth of field from magnification calculator benefit from a dedicated landing whose free path matches the paid automation path byte-for-byte on the same pure module—distinct from the general depth-of-field calculator that starts from focal length and focus distance. Keep requests small, pin the rounded millimetre totals in tests, and you get reproducible macro DOF for field notes, LMS plugins, and edge workers without standing up optical design software of your own.

Plan macro aperture before stacking

Enter life-size or 2:1 magnification, your working f-number, and CoC to get total DOF in millimetres and decide whether one shot covers the subject or a stack is required.

Classroom macro DOF drills

Return deterministic total DOF from textbook magnification, aperture, and CoC so teachers and auto-graders share one ground truth.

How do I calculate depth of field from magnification?

The answer is in millimetres when c is in millimetres.

How is this different from a normal depth of field calculator?

The classic calculator needs focal length and subject distance and routes through hyperfocal distance. This tool is for close-up and macro when you know reproduction ratio and stop, not distance in metres—a different search intent and formula.

What magnification should I enter for 1:1 or 1:2?

Always use the absolute linear ratio image size over object size on the sensor.

What is the pupil factor and when do I change it?

Pupil factor p is exit pupil over entrance pupil. Leave it at the default 1 for symmetrical or near-symmetrical lenses. Set a different positive p only when your lens data sheet quotes a non-unit pupil magnification.

What is the effective f-number in macro photography?

At life size, f/8 behaves like f/16 for exposure, because the working aperture grows with magnification. The calculator gives this effective value so you can note the light loss in your macro settings.

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/photo-dof-from-magnification

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/photo-dof-from-magnification \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"magnification":1,"aperture":8,"circle_of_confusion_mm":0.03}'
{
  "magnification": 1,
  "aperture": 8,
  "circle_of_confusion_mm": 0.03
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "hobby.photo_dof_from_magnification",
  "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.

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.

Why magnification fixes total DOF in close-up work

The pipeline is pure arithmetic with fixed rounding so identical inputs always produce identical JSON across runtimes.

Input contract, response shape, and error behaviour

Wire the free browser form for field decisions, then call the identical contract from stacking planners when you need tables across a stop sequence. POST a JSON body with three required finite positive numbers: magnification m as a dimensionless ratio such as one for life size or zero point five for half life size; aperture as the f-number N such as two point eight, five point six, or eight; and circle_of_confusion_mm as the CoC diameter in millimetres, for example zero point zero three for a common full-frame criterion or about zero point zero one nine for many APS-C conventions. An optional pupil_factor p defaults to one when omitted; when present it must also be finite and strictly positive. Aliases are accepted so scripts written against textbook notation need no rename layer: m, mag, reproduction_ratio, or ratio for magnification; f_number, fnumber, f_stop, fstop, N, or fn for aperture; coc, coc_mm, circle_of_confusion, or c for the CoC; and pupil, p, or pupil_magnification for the pupil factor. Missing fields, non-numeric strings, NaN, Infinity, zero, and negative values fail with invalid_input naming the field and are not billed. On success the response echoes cleaned magnification, aperture, circle_of_confusion_mm, and pupil_factor; flags whether the pupil defaulted; returns total_dof_mm and half_dof_mm; returns effective_f_number equal to N times one plus m over p; and includes unit millimetres, a short formula string, a human message, and a step list for display. Classic checks include one-to-one at f slash eight with zero point zero three millimetre CoC for a life-size insect frame, half life size at f slash five point six for product close-ups, and a zero or negative magnification as the mandatory invalid_input path. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where a magnification-based DOF calculator earns its keep

Focus-stacking tools that already estimate subject depth still need a DOF-per-shot number; feeding magnification and stop into this endpoint yields that slab without forcing the user to invent a subject distance in metres. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

DOF-per-shot for focus-stacking tools

Feed reproduction ratio and stop into the API so a stacking planner can estimate frames without inventing subject distance in metres.

What does the depth of field from magnification calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →