{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"depth-of-field"},"result":{"entity_type":"calculator","id":"depth-of-field","calculator_id":"depth-of-field","canonical_url":"https://tttkmbb.com/photography/depth-of-field","name":"Depth of Field Calculator","title":"Depth of Field Calculator – Near/Far Sharpness Limits and Hyperfocal Distance by Sensor","category":"photography","category_name":"Photography & Optics","tool_name":"calculate_depth_of_field","featured_mcp_tool":true,"description":"Computes the near and far limits of acceptable sharpness, the total depth of field and the hyperfocal distance from focal length, f-number, focus distance and the sensor's circle of confusion, using the standard thin-lens depth-of-field equations.","use_when":"You need to know how much of a scene is acceptably sharp for given camera settings, or how far sharpness extends in front of and behind the focused subject.","do_not_use_when":"You only need the focus distance that maximises depth of field (use hyperfocal-distance), or you shoot macro above about 0.2× magnification where lens extension and pupil magnification make the thin-lens equations inaccurate.","inputs":[{"name":"focal_length_mm","label":"Focal length","type":"number","unit":"mm","required":true,"min":1,"max":5000,"description":"Actual (not equivalent) focal length of the lens in millimetres.","example":50},{"name":"aperture_f","label":"Aperture (f-number)","type":"number","required":true,"min":0.5,"max":128,"description":"Lens f-number, e.g. 2.8 for f/2.8.","example":2.8},{"name":"focus_distance_m","label":"Focus distance","type":"number","unit":"m","required":true,"max":100000,"exclusive_min":0,"description":"Distance from the camera's sensor plane to the focused subject in metres.","example":3},{"name":"sensor","label":"Sensor format","type":"enum","required":false,"default":"full_frame","values":[{"value":"full_frame","label":"Full frame (36 × 24 mm)","aliases":["ff","35mm","full-frame"]},{"value":"aps_c","label":"APS-C (23.5 × 15.6 mm; Nikon, Sony, Fujifilm, Pentax)","aliases":["apsc","aps-c","crop"]},{"value":"aps_c_canon","label":"APS-C Canon (22.3 × 14.9 mm)","aliases":["canon_aps_c","canon"]},{"value":"micro_four_thirds","label":"Micro Four Thirds (17.3 × 13 mm)","aliases":["mft","m43","four_thirds"]},{"value":"one_inch","label":"1-inch type (13.2 × 8.8 mm)","aliases":["1_inch","1-inch","type_1"]},{"value":"medium_format_44x33","label":"Medium format 44 × 33 (43.8 × 32.9 mm)","aliases":["medium_format","gfx","44x33"]},{"value":"smartphone_1_over_2_3","label":"Smartphone 1/2.3-inch (6.17 × 4.55 mm)","aliases":["smartphone","phone","1/2.3"]}],"description":"Sensor format; selects the circle of confusion (0.030 mm full frame, 0.020 mm APS-C, 0.015 mm Micro Four Thirds ...).","example":"full_frame"},{"name":"coc_mm","label":"Circle of confusion (override)","type":"number","unit":"mm","required":false,"max":1,"exclusive_min":0,"description":"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).","example":0.03}],"outputs":[{"name":"hyperfocal_m","label":"Hyperfocal distance","type":"number","unit":"m","decimals":3,"description":"H = f²/(N·c) + f: focusing here gives sharpness from H/2 to infinity."},{"name":"near_limit_m","label":"Near limit","type":"number","unit":"m","decimals":3,"description":"Closest distance that is acceptably sharp."},{"name":"far_limit_m","label":"Far limit","type":"number","unit":"m","decimals":3,"description":"Farthest distance that is acceptably sharp; omitted when it is infinite (see far_limit_text)."},{"name":"far_limit_text","label":"Far limit (text)","type":"string","decimals":4,"description":"Far limit as text, 'infinity' when the focus distance is at or beyond the hyperfocal distance."},{"name":"total_dof_m","label":"Total depth of field","type":"number","unit":"m","decimals":3,"description":"far − near; omitted when the far limit is infinite."},{"name":"in_front_of_subject_m","label":"Sharp zone in front of subject","type":"number","unit":"m","decimals":3,"description":"focus_distance − near limit."},{"name":"behind_subject_m","label":"Sharp zone behind subject","type":"number","unit":"m","decimals":3,"description":"far limit − focus_distance; omitted when infinite."},{"name":"coc_used_mm","label":"Circle of confusion used","type":"number","unit":"mm","decimals":3,"description":"Circle of confusion diameter applied (preset or override)."}],"input_schema":{"type":"object","properties":{"focal_length_mm":{"description":"Actual (not equivalent) focal length of the lens in millimetres. Unit: mm.","type":"number","minimum":1,"maximum":5000,"examples":[50],"x-unit":"mm"},"aperture_f":{"description":"Lens f-number, e.g. 2.8 for f/2.8.","type":"number","minimum":0.5,"maximum":128,"examples":[2.8]},"focus_distance_m":{"description":"Distance from the camera's sensor plane to the focused subject in metres. Unit: m.","type":"number","maximum":100000,"exclusiveMinimum":0,"examples":[3],"x-unit":"m"},"sensor":{"description":"Sensor format; selects the circle of confusion (0.030 mm full frame, 0.020 mm APS-C, 0.015 mm Micro Four Thirds ...).","type":"string","enum":["full_frame","aps_c","aps_c_canon","micro_four_thirds","one_inch","medium_format_44x33","smartphone_1_over_2_3"],"default":"full_frame","examples":["full_frame"]},"coc_mm":{"description":"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). Unit: mm.","type":"number","maximum":1,"exclusiveMinimum":0,"examples":[0.03],"x-unit":"mm"}},"additionalProperties":false,"required":["focal_length_mm","aperture_f","focus_distance_m"]},"output_schema":{"type":"object","properties":{"hyperfocal_m":{"description":"H = f²/(N·c) + f: focusing here gives sharpness from H/2 to infinity. Unit: m.","type":"number","x-unit":"m"},"near_limit_m":{"description":"Closest distance that is acceptably sharp. Unit: m.","type":"number","x-unit":"m"},"far_limit_m":{"description":"Farthest distance that is acceptably sharp; omitted when it is infinite (see far_limit_text). Unit: m.","type":"number","x-unit":"m"},"far_limit_text":{"description":"Far limit as text, 'infinity' when the focus distance is at or beyond the hyperfocal distance.","type":"string"},"total_dof_m":{"description":"far − near; omitted when the far limit is infinite. Unit: m.","type":"number","x-unit":"m"},"in_front_of_subject_m":{"description":"focus_distance − near limit. Unit: m.","type":"number","x-unit":"m"},"behind_subject_m":{"description":"far limit − focus_distance; omitted when infinite. Unit: m.","type":"number","x-unit":"m"},"coc_used_mm":{"description":"Circle of confusion diameter applied (preset or override). Unit: mm.","type":"number","x-unit":"mm"}}},"formula":"H = f² / (N·c) + f; near = s·(H − f) / (H + s − 2f); far = s·(H − f) / (H − s) when s < H, otherwise infinity (f = focal_length_mm, N = aperture_f, c = coc_mm, s = focus_distance_m × 1000, all in mm)","method":"Thin-lens approximation with a sensor-dependent circle of confusion (diagonal / 1500 convention). Lens makers and apps use slightly different CoC values, so limits can differ by 10–20 %; distances are measured from the sensor plane.","sources":[{"name":"Wikipedia – Depth of field","url":"https://en.wikipedia.org/wiki/Depth_of_field","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Circle of confusion","url":"https://en.wikipedia.org/wiki/Circle_of_confusion","type":"reference","retrieved_at":"2026-09-24"},{"name":"Cambridge in Colour – Understanding depth of field","url":"https://www.cambridgeincolour.com/tutorials/depth-of-field.htm","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"50 mm, f/2.8, focused at 3 m, full frame","inputs":{"focal_length_mm":50,"aperture_f":2.8,"focus_distance_m":3,"sensor":"full_frame"},"expected":{"hyperfocal_m":29.812,"near_limit_m":2.729,"far_limit_m":3.33,"total_dof_m":0.601,"coc_used_mm":0.03},"url":"https://tttkmbb.com/api/v1/calculate/depth-of-field?focal_length_mm=50&aperture_f=2.8&focus_distance_m=3&sensor=full_frame"},{"name":"24 mm, f/8, focused at 5 m, full frame (beyond hyperfocal)","inputs":{"focal_length_mm":24,"aperture_f":8,"focus_distance_m":5,"sensor":"full_frame"},"expected":{"hyperfocal_m":2.424,"near_limit_m":1.627,"far_limit_text":"infinity","in_front_of_subject_m":3.373},"url":"https://tttkmbb.com/api/v1/calculate/depth-of-field?focal_length_mm=24&aperture_f=8&focus_distance_m=5&sensor=full_frame"}],"faq":[{"q":"Why does the sensor size change the depth of field?","a":"Smaller sensors are enlarged more for the same print, so the acceptable blur (circle of confusion) is smaller: 0.020 mm for APS-C versus 0.030 mm for full frame. For the same lens and settings that shrinks the depth of field slightly."},{"q":"Why is the far limit 'infinity'?","a":"When the focus distance is at or beyond the hyperfocal distance H, everything from the near limit to infinity is acceptably sharp, so the far limit and total depth of field are unbounded."},{"q":"Is the 1/3 in front, 2/3 behind rule built in?","a":"No, the split is computed exactly; it is close to 1/3–2/3 only at moderate distances and approaches 1/2–1/2 in macro range and 'to infinity' near the hyperfocal distance."}],"tags":["depth of field","dof calculator","near far limit","circle of confusion","hyperfocal","focus distance"],"related":[{"calculator_id":"hyperfocal-distance","reason":"Focus distance that gives sharpness from half that distance to infinity."},{"calculator_id":"field-of-view","reason":"Angle of view and frame coverage for the same lens and sensor."},{"calculator_id":"crop-factor","reason":"Sensor diagonal, crop factor and equivalent aperture for depth of field."}],"links":{"html":"https://tttkmbb.com/photography/depth-of-field","markdown":"https://tttkmbb.com/photography/depth-of-field.md","json":"https://tttkmbb.com/photography/depth-of-field.json","api":"https://tttkmbb.com/api/v1/calculate/depth-of-field","schema":"https://tttkmbb.com/api/v1/calculators/depth-of-field","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T03:51:44Z"}