HomeArticlesMathematics

Buffon's Needle: How a Dropped Needle Recreates Pi

An 18th-century needle-and-lines experiment where the crossing probability 2L/(pi*d) lets you back out an estimate of pi from nothing but counting.

mysimulator teamUpdated June 2026≈ 7 min read▶ Open the simulation

An 18th-century experiment that still runs in a browser

In 1733, Georges-Louis Leclerc, Comte de Buffon, posed a question that turned out to hide π inside pure geometry: drop a needle of length L onto a floor ruled with parallel lines spaced d apart (with L ≤ d). What is the probability it crosses a line? Buffon answered his own question in 1777, and the surprising result is that the crossing probability depends on π itself — which means you can run the experiment thousands of times, count the crossings, and back out an estimate of π from nothing but counting and geometry, a century and a half before anyone coined the term Monte Carlo method.

live demo · needles dropping onto ruled lines, crossings counted live● LIVE

Where the formula comes from

A dropped needle is fully described by two independent random variables: the distance y from its centre to the nearest line (uniform on [0, d/2]) and the angle θ it makes with the lines (uniform on [0, π/2] by symmetry). The needle crosses the nearest line exactly when the vertical reach of its half-length, (L/2)·sinθ, exceeds y. Integrating that condition's probability over both uniform variables gives a strikingly clean closed form:

P(crossing) = 2L / (π * d)          (for L ≤ d)

Rearranged, after N drops with C crossings:
π ≈ 2LN / (dC)

In the special case L = d, the formula collapses to the tidy P = 2/π ≈ 0.6366, so roughly two out of every three dropped needles cross a line. Note that the crossing probability itself doesn't involve π in a way you can invert without care — it's precisely because π sits in the denominator of a ratio of two directly measurable quantities (the count of crossings versus drops) that the experiment works as an estimator at all.

The same slow convergence as the dartboard method

Buffon's needle is another Bernoulli-trial estimator, so it inherits the same 1/√n convergence as Monte Carlo pi estimation: each needle drop is independent, the crossing/no-crossing outcome has fixed variance, and the standard error of the resulting π-estimate shrinks proportionally to the square root of the number of drops. Historically this made it a poor practical way to compute π — 19th-century enthusiasts who physically dropped thousands of needles by hand, including a famous (probably apocryphal or at least suspiciously accurate) 1901 experiment by Mario Lazzarini, got only a few correct digits for enormous effort. As a demonstration of geometric probability, though, it's unmatched: it shows π arising from an experiment that involves no circles at all, only straight lines and a straight needle.

Buffon-Laplace: what happens with a grid instead of parallel lines

Pierre-Simon Laplace generalised the problem in 1812 by ruling the floor with a full rectangular grid (two perpendicular sets of parallel lines, spacings a and b) instead of just one direction of parallel lines. The needle can now cross a horizontal line, a vertical line, both, or neither, and the crossing probability becomes a more elaborate expression in L, a and b that still resolves to a formula containing π. The Buffon–Laplace problem is the natural bridge between the single-direction needle experiment and later geometric-probability results — the same reasoning, extended to two independent line families, that shows up again in stereology (estimating 3D structure from 2D cross-sections) and in Monte Carlo methods for spatial statistics.

What makes a needle problem "geometric probability"

Buffon's needle is the founding example of geometric probability — problems where the sample space is continuous positions and orientations rather than discrete outcomes, and probabilities are computed as ratios of measures (areas, lengths, or, more generally, integrals over configuration space) rather than by counting equally likely cases. That framing is what later grew into integral geometry and stereology, fields with real applications in materials science and medical imaging where you infer 3D microstructure — grain sizes in a metal, or vessel density in tissue — from the statistics of how a probe (a line, a needle, a cutting plane) intersects it.

Frequently asked questions

Does the needle length have to be shorter than the line spacing?

For the classic short-needle formula P = 2L/(pi*d) to hold as stated, yes, L must be less than or equal to d. If the needle is longer than the spacing it can cross more than one line at once, and the crossing-probability formula becomes more complex (it can even involve an inverse cosine term), though it still resolves to an expression containing pi.

How many needle drops does it take to get an accurate estimate of pi?

The convergence is the same 1/sqrt(n) rate as any Monte Carlo estimator: getting one more correct decimal digit needs roughly 100x more drops. Tens of thousands of simulated drops typically nail down 2-3 digits reliably; matching a calculator's precision this way would take an astronomical number of trials.

Is Buffon's needle actually how anyone computes pi today?

No, it's a historical curiosity and a teaching demonstration of geometric probability, not a competitive method. Modern high-precision computations of pi use fast deterministic algorithms like the Chudnovsky series, which converge exponentially rather than as a slow random walk.

Try it live

Everything above runs in your browser — open Buffon's Needle and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Buffon's Needle simulation

What did you find?

Add reproduction steps (optional)