Sturges' Rule Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/10/2026
Sturges' rule estimates the number of bins (intervals) to use to build a histogram from a number of observations: k = 1 + 3.322 × log₁₀(n). For 100 observations, it recommends about 8 bins.
Explanation
Building a meaningful histogram requires choosing a number of bins that is neither too small (which hides the real shape of the distribution by grouping too much data together) nor too large (which produces a noisy histogram, with bins containing too few observations to be significant). Sturges' rule, proposed in 1926, remains one of the most used methods to estimate a reasonable number of bins from the sample size alone: it rests on the idea that a dataset approximately following a normal distribution can be broken into bins whose counts follow a binomial distribution, which leads to the number of bins k = 1 + log₂(n) — mathematically identical to 1 + 3.322 × log₁₀(n), since log₂(n) = log₁₀(n) ÷ log₁₀(2) and 1 ÷ log₁₀(2) ≈ 3.322. This rule has its limits, well documented in the statistical literature: it tends to underestimate the optimal number of bins for very large samples, and implicitly assumes a near-normal distribution — alternative rules like Scott's or the Freedman-Diaconis rule, which account for the actual dispersion of the data rather than only its count, are sometimes preferred for large or strongly asymmetric datasets. The number of bins obtained nonetheless remains a reasonable starting point, to be adjusted visually according to the shape of the resulting histogram — a choice that directly affects the reading of the dispersion and central tendency visible on the graph, two pieces of information also summarized, more compactly, by our median and range calculator.
Example: 100 observations
Inputs
Number of observations: 100.
Calculation
k = 1 + 3.322 × log₁₀(100) = 1 + 3.322 × 2 = 1 + 6.644 = 7.644, rounded up to 8 bins.
Result
For 100 observations, Sturges' rule recommends about 8 bins.
Frequently asked questions
Why round the result up (ceiling)?
The number of bins of a histogram must be an integer, and rounding up rather than to the nearest is the most common convention: it avoids slightly underdimensioning the recommended number of bins, an extra bin having a far less disruptive visual impact than a missing one.
Is Sturges' rule suitable for all datasets?
It gives good results for moderately sized samples approximately following a normal distribution, but it is known to underestimate the optimal number of bins on very large samples (several thousand observations) and to adapt poorly to strongly asymmetric distributions. In these cases, alternative rules like Scott's or Freedman-Diaconis, which account for the actual dispersion of the data, are often preferred.
What happens with a very small number of observations?
The formula stays mathematically defined (it gives 1 bin for a single observation), but a histogram built from very little data is hardly informative anyway, whatever the method used to choose the number of bins: the shape of a distribution only becomes visible from a sufficient number of observations.