FREE TOOL: Use Our Free Hyperfocal Distance Calculator for Sharper Landscapes
Jan 7, 2026
Share:

Struggling to keep everything sharp from foreground to background? That’s a depth-of-field problem. This calculator lets you enter your camera, focal length, aperture, and subject distance to calculate the hyperfocal distance, so you know exactly where to focus to maximise sharpness throughout the scene.
How to use the calculator:
- Enter your focal length in millimetres.
- Set the aperture (f-number) you plan to use.
- Choose your sensor / format to account for circle of confusion.
- Select result units (meters or feet).
- Read the minimum focus distance, hyperfocal distance, and maximum focus distance.
- Use Copy result if you want to paste the values into notes or a shooting plan.
Hyperfocal Distance (quick explainer)
The hyperfocal distance is the closest point you can focus at while still keeping everything from half that distance to infinity acceptably sharp.
- Focus at the hyperfocal distance → foreground to infinity stays sharp.
- Focus closer than hyperfocal → you lose sharpness at infinity.
- Smaller apertures and wider lenses reduce the hyperfocal distance.
This calculator uses standard circle-of-confusion values for each sensor format to give practical, real-world results rather than theoretical extremes.
For website owners: embed this on your site
Quick start
Paste this where you want the calculator to appear (WordPress “Custom HTML” block is fine):
<div class="diyp-hyperfocal-calculator"></div>
<link rel="stylesheet" href="https://www.diyphotography.net/diyptools/diyp-hyperfocal-calc.min.css">
<script src="https://www.diyphotography.net/diyptools/diyp-hyperfocal-calc.min.js" async defer></script>
You can add multiple calculators on a page—just add more <div class="diyp-hyperfocal-calculator"> blocks. All logic runs client-side.
Optional parameters (data-attributes)
Add these to the <div class="diyp-hyperfocal-calculator"> to set defaults or theme.
| Attribute | Values | Default | What it does |
|---|---|---|---|
data-title | Any text | DIYPhotography.net Hyperfocal Distance Calculator | Sets the visible header title. |
data-focal | Number in mm (e.g. 50) | 50 | Sets the starting focal length. |
data-aperture | Number (e.g. 8) | 8 | Sets the starting aperture (f-number). |
data-sensor | ff | aps15 | aps16 | mft | mf | ff | Sets the starting sensor/format (affects circle of confusion). |
data-units | m | ft | m | Sets the starting units for the result readout. |
data-theme | light | dark | light | Chooses the color theme. |
Examples
Dark theme, feet:
<div class="diyp-hyperfocal-calculator" data-theme="dark" data-units="ft"></div>
Custom starting values (35mm, f/11, APS-C 1.5×):
<div class="diyp-hyperfocal-calculator" data-focal="35" data-aperture="11" data-sensor="aps15"></div>
Custom title:
<div class="diyp-hyperfocal-calculator" data-title="Acme Lab — Hyperfocal Helper"></div>
Notes for embedders
- What it calculates: hyperfocal distance, plus the near limit when focused at hyperfocal (approximately half the hyperfocal distance) and a far limit of infinity.
- Units: focal length is always in mm. Result units can be meters or feet.
- Sensor values:
ff,aps15,aps16,mft,mfmap to built-in circle-of-confusion values used by the calculator. - Rounding: meters are shown to 2 decimals; feet are shown to 1 decimal.
- Styling: CSS is namespaced under
.diyp-hyperfocal-calculatorto reduce conflicts. - Multiple instances: the script auto-initialises any
.diyp-hyperfocal-calculatorit finds on page load. - Performance: no network calls after the CSS/JS files load; everything runs in the browser.
John Aldred
John Aldred is a photographer with over 25 years of experience in the portrait and commercial worlds. He is based in Scotland and has been an early adopter – and occasional beta tester – of almost every digital imaging technology in that time. As well as his creative visual work, John uses 3D printing, electronics and programming to create his own photography and filmmaking tools and consults for a number of brands across the industry.



































Join the Discussion
DIYP Comment Policy
Be nice, be on-topic, no personal information or flames.
One response to “FREE TOOL: Use Our Free Hyperfocal Distance Calculator for Sharper Landscapes”
Suggestion: use a laser rangefinder (the type with a viewfinder is better) to find something on which to focus at the distance found by the tool since it may not be written on the scale or there may even not be a scale on the lens (where is 10.47 metres on the focusing scale?). Lock the distance by shifting into manual focus, reframe and take your picture. Remember to buy the most powerful laser rangefinder you can find and afford – the laser spot may not be visible on objects at the right distance with weaker rangefinder models. Follow the safety rules for the use of laser instruments.
Oh well, one more thing to carry, take time using and adding to the cost.