Calculators·Optics & depth of field

Pinhole camera: optimal hole diameter.

Find the optimal pinhole diameter for your camera obscura – calculated with scientific precision for maximum image sharpness.

Includes diffraction analysis, f-number, sharpness index, and adjustment for different wavelengths of light.

  • Camera obscura
  • Diffraction analysis
  • Multiple wavelengths
  • Build guide

Pinhole Camera Aperture Calculator

Calculate the optimal pinhole diameter for your camera obscura. The calculator determines the ideal hole size for maximum image sharpness based on distances and the wavelength of light.

m

Distance from the pinhole to the photographed object

cm

Distance from the pinhole to the film plane or sensor

Current wavelength: 550 nm

A pinhole camera (camera obscura) is the simplest form of camera. Instead of a lens, the image is projected onto film or sensor through a tiny hole.

Principle: Light rays from the subject pass through the hole and form an inverted image on the opposite side.

Note: Theoretically infinite depth of field, but resolution is limited by diffraction. The optimal pinhole diameter balances both effects.

Optimal pinhole diameter:

d = √((3.6 × λ × f) ÷ (1 + f/g))

d = Optimal diameter

λ = Wavelength of light

f = Image distance (pinhole to film/sensor)

g = Object distance (pinhole to subject)

The formula minimizes the sum of diffraction blur and geometric blur.

Drilling the hole: Use thin metal (aluminum foil, brass sheet) and drill from both sides to avoid burrs.

Exposure time: Pinhole cameras have very high f-numbers. Expect exposure times from seconds to hours.

Adjusting the image distance: A larger image distance = larger images, but also longer exposure times and a larger optimal pinhole diameter.

Physics

Understanding the pinhole camera.

The simplest camera in the world uses just a hole and a dark chamber – and with the right pinhole size it still delivers surprisingly sharp images.

Camera-obscura principle

No lens, just a hole.

Light rays from every point of the subject pass through the tiny hole and hit the corresponding point on the image plane – inverted. Unlike a lens, there is theoretically no limit to depth of field: everything from near to far is rendered equally „sharp" – but ultimately constrained by the pinhole size.
Optimization

Two competing effects.

A hole that is too small causes diffraction blur, a hole that is too large causes geometric blur from multiple light rays hitting the same image point. The optimal diameter minimizes both effects and delivers the best possible sharpness for the chosen parameters.
Calculation in detail

One formula, many variables.

The standard formula for the optimal pinhole diameter balances diffraction and geometry – taking both image and object distance into account.

d = √((3.6 × λ × f) ÷ (1 + f/g))
Variables
  • d = optimal diameter (mm)
  • λ = light wavelength (mm)
Conditions
  • f = image distance (mm)
  • g = object distance (mm)

The formula is based on minimizing the circle of confusion by balancing diffraction against geometric blur.

Build guide

Step by step to your own pinhole camera.

With a few simple materials a box turns into an optical instrument. This guide walks you through materials, drilling, exposure, and sharpness tuning.

1. Materials & tools

What you need.

  • Light-tight box or housing
  • Thin metal foil (0.1 – 0.2 mm)
  • Fine needle or laser
  • Black tape
  • Magnifying glass for inspection
2. Drill the hole precisely

How the hole takes shape.

  • Clamp the foil between wooden blocks
  • Drill carefully from both sides
  • Remove burrs with fine sandpaper
  • Inspect the diameter with a magnifier
Exposure times

Long exposures, not snapshots.

Typical f-numbers from f/200 to f/500 require very long exposure times: daylight 1 – 30 s, overcast 2 – 10 min, indoors 10+ min.
Choose image distance

Bigger box, bigger image.

The image distance defines both image size and pinhole diameter: 35 mm film 5 – 15 cm, large format 20 – 50 cm, room scale 100 cm+.
Optimize sharpness

Four key factors.

Accurate pinhole diameter, perfectly circular shape, smooth hole edges, and a stable camera – these four factors decide sharpness and image quality.
Camera types

Four designs at a glance.

From shoebox to room-size camera – every design has its own appeal and strengths.

Box cameras

Classics in cardboard or wood.

Classic shoebox or wooden box cameras for 35 mm film or photo paper. Ideal for beginners – cheap and quick to build.
Body caps

Digital with a pinhole.

Pinhole apertures used in place of lenses on DSLRs or mirrorless cameras. Enables digital pinhole photography with instant image review.
Room cameras

Entire rooms as a camera.

Whole rooms become a camera obscura via a hole in a window or wall. Spectacular installations and unforgettable experiences.
Smartphone adapters

Easy to experiment.

Dedicated adapters for smartphones make pinhole experiments simple, with instant feedback and no material costs.
Wavelength & quality

Colors and optimal diameters.

Different wavelengths require slightly different hole diameters. For panchromatic film or digital sensors, green (550 nm) is the best compromise.

UV
380 nm
Blue
450 nm
Green
550 nm
Red
650 nm
Pro tips

Four pointers for better pinhole images.

Pick your wavelength deliberately
For panchromatic films or digital sensors, 550 nm (green light) is the best compromise because it matches peak sensitivity.
Drilling quality is everything
Smooth, perfectly round hole edges make the difference. An irregular hole shape distributes light unevenly and ruins sharpness.
Stability for long exposures
During multi-minute exposures every movement becomes visible. A tripod and a stable surface are essential.
Test your exposure
Since pinhole cameras don't allow metering through an aperture, bracketing helps: shoot several frames with doubled times and pick the best one.
FAQ

Answers to common questions.

From tool to skill

Solid photography knowledge.

Calculators give you the number. On the blog and in 1:1 coaching I turn theory into results you can see in your images.

Fotograf, Martin Fernando Mera Kleinheinz · Franz-Bork-Straße 21, 30163 Hannover · 0179 4085397