# Sturges's rule

**Sturges's rule** is a formula for choosing the number of classes (bins) in a histogram or frequency distribution from the sample size alone: 
\[ k = 1 + \log_{2}(n) \]
where \( n \) is the number of observations. Herbert A. Sturges of Washburn College published it in the *Journal of the American Statistical Association* in 1926, and it was the first bin-count rule in the statistical literature.<sup>[1](https://www.stat.rice.edu/~scottdw/stat550/DEMOS/09-14-hist/Sturges1926.pdf)</sup><sup> • </sup><sup>[2](https://onlinelibrary.wiley.com/doi/full/10.1002/wics.35)</sup> It remains the default bin rule in R's `hist()` function and is one of the named estimators in NumPy.<sup>[3](https://search.r-project.org/R/refmans/graphics/help/hist.html)</sup><sup> • </sup><sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup>

| Key fact | Detail |
|---|---|
| Formula | \( k = 1 + \log_{2}(n) \), equivalently \( k = 1 + 3.322 \log_{10}(n) \)<sup>[1](https://www.stat.rice.edu/~scottdw/stat550/DEMOS/09-14-hist/Sturges1926.pdf)</sup><sup> • </sup><sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup> |
| Origin | Herbert A. Sturges, "The Choice of a Class Interval," *Journal of the American Statistical Association* 21 (1926): 65–66<sup>[1](https://www.stat.rice.edu/~scottdw/stat550/DEMOS/09-14-hist/Sturges1926.pdf)</sup><sup> • </sup><sup>[2](https://onlinelibrary.wiley.com/doi/full/10.1002/wics.35)</sup> |
| What it uses | Sample size only; it never looks at the spread or shape of the data<sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup> |
| Assumption | Data roughly normal; optimal only for Gaussian data<sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup> |
| Known weakness | Underestimates the number of bins for large or non-normal datasets, oversmoothing the histogram<sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup><sup> • </sup><sup>[5](https://www.stat.rice.edu/~scottdw/stat550/Lectures/Chapter3.pdf)</sup> |
| Software status | Default in R's `hist()`; the `sturges` option in NumPy; NumPy's `auto` takes the maximum of Sturges and Freedman–Diaconis<sup>[3](https://search.r-project.org/R/refmans/graphics/help/hist.html)</sup><sup> • </sup><sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup> |

## Origin and rationale

Sturges's 1926 note, "The Choice of a Class Interval," addressed how to divide a statistical series of range \( R \) with \( N \) items into classes. He gave the class interval as 
\[ C = \frac{R}{1 + 3.322 \log N} \]
which is equivalent to a bin count of \( 1 + \log_{2}(n) \).<sup>[1](https://www.stat.rice.edu/~scottdw/stat550/DEMOS/09-14-hist/Sturges1926.pdf)</sup>

The derivation rests on a binomial argument. Sturges proposed that the binomial coefficients \( \binom{k-1}{i} \) could serve as the idealized bin counts of normal data as the number of bins \( k \) grows, since the binomial distribution approaches the normal as \( k \) increases. For example, 16 items would divide naturally into 5 classes with frequencies 1, 4, 6, 4, 1, and a series of 64 items (the sixth power of 2) into 7 classes.<sup>[1](https://www.stat.rice.edu/~scottdw/stat550/DEMOS/09-14-hist/Sturges1926.pdf)</sup><sup> • </sup><sup>[6](https://www.stat.rice.edu/~scottdw/ss.nh.pdf)</sup> Summing the binomial coefficients for a given \( k \) yields \( 2^{k-1} \), so \( k = 1 + \log_{2}(n) \).

Sturges also offered practical guidance on applying the formula. He noted that the most convenient class intervals are 1, 2, 5, 10, 20, and so on, and recommended choosing a convenient interval near the theoretical one: if the formula gives 9, use 10, but if it indicates 7 or 8, use 5. For computations involving two series, such as a correlation coefficient with an approximate value \( r \) known in advance, he derived a variant, 
\[ C = \frac{R}{1 + (1.661 + 1.661\,r) \log N} \]
which for many biological correlations with \( r \approx 0.50 \) gives a coefficient of about 2.5 on \( \log N \).<sup>[1](https://www.stat.rice.edu/~scottdw/stat550/DEMOS/09-14-hist/Sturges1926.pdf)</sup>

## How the rule behaves

Because the rule depends only on \( n \), the bin count grows logarithmically: about 8 bins for 100 observations and about 11 for 1,000.<sup>[7](https://histogramhub.com/blog/sturges-scott-freedman-diaconis-bin-rules)</sup> David W. Scott, the Noah Harding Professor of Statistics Emeritus at [Rice University](https://www.edgepedia.org/rice-university) who wrote the standard review of the rule, tabulates the resulting counts alongside the width-based alternatives:<sup>[2](https://onlinelibrary.wiley.com/doi/full/10.1002/wics.35)</sup><sup> • </sup><sup>[8](https://www.stat.rice.edu/~scottdw/)</sup>

| \( n \) | Sturges | Scott | Freedman–Diaconis |
|---:|---:|---:|---:|
| 50 | 5.6 | 6.3 | 8.5 |
| 100 | 7.6 | 8.0 | 10.8 |
| 1,000 | 11.0 | 17.2 | 23.2 |
| 10,000 | 14.3 | 37.0 | 49.9 |
| 100,000 | 17.6 | 79.8 | 107.6 |

The gap widens with sample size because the logarithm grows too slowly. Scott's assessment is that Sturges's rule is too conservative at large \( n \), oversmoothing the histogram and losing information with bins that are too wide.<sup>[5](https://www.stat.rice.edu/~scottdw/stat550/Lectures/Chapter3.pdf)</sup> On a Beta(5, 5) density, his figures put Sturges's implied bin width 13.7 percent too large at \( n = 128 \), 65.3 percent too large at \( n = 1{,}024 \), and 772.9 percent too large at \( n = 1{,}048{,}576 \), with integrated error 1.7, 31.4, and 2,447.5 percent larger than the optimum respectively.<sup>[5](https://www.stat.rice.edu/~scottdw/stat550/Lectures/Chapter3.pdf)</sup>

The rule also ignores the data entirely beyond the count. A skewed or outlier-bearing sample gets the same bin count as a symmetric one of the same size, since spread never enters the formula.<sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup><sup> • </sup><sup>[7](https://histogramhub.com/blog/sturges-scott-freedman-diaconis-bin-rules)</sup>

## Relation to other bin rules

Later rules take a different route: they choose a bin width \( h \), from which the count follows by dividing the data range by \( h \). Two normal reference rules dominate practice.<sup>[5](https://www.stat.rice.edu/~scottdw/stat550/Lectures/Chapter3.pdf)</sup>

**Scott's rule**, from Scott's 1979 [Biometrika](https://www.edgepedia.org/biometrika) paper "On Optimal and Data-Based Histograms," minimizes the asymptotic integrated mean squared error of the histogram and, assuming normal data, gives 
\[ h = 3.49 \, \hat{\sigma} \, n^{-1/3} \]
with \( \hat{\sigma} \) the sample standard deviation. The \( n^{-1/3} \) scaling is asymptotically optimal for histogram bin widths generally.<sup>[5](https://www.stat.rice.edu/~scottdw/stat550/Lectures/Chapter3.pdf)</sup><sup> • </sup><sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup>

**The Freedman–Diaconis rule**, from David Freedman and [Persi Diaconis](https://www.edgepedia.org/persi-diaconis)'s 1981 paper "On the Histogram as a Density Estimator: L2 Theory," replaces the standard deviation with the interquartile range: 
\[ h = 2 \cdot \mathrm{IQR} \cdot n^{-1/3} \]
The IQR, the distance between the 25th and 75th percentiles, is robust to outliers, so a few extreme values barely move the bin width. For normal data the Freedman–Diaconis width is about 23 percent narrower than Scott's.<sup>[5](https://www.stat.rice.edu/~scottdw/stat550/Lectures/Chapter3.pdf)</sup>

The contrast with Sturges is structural. A count-based rule like Sturges cannot respond to spread, so an outlier changes nothing; a width-based rule adapts to how spread out the numbers are, which is why Scott's rule suits roughly bell-shaped data and Freedman–Diaconis suits skewed or outlier-heavy data.<sup>[7](https://histogramhub.com/blog/sturges-scott-freedman-diaconis-bin-rules)</sup> NumPy's documentation describes `sturges` as optimal only for Gaussian data and underestimating bins for large non-Gaussian datasets, and its `auto` default takes the maximum of the Sturges and Freedman–Diaconis estimates, choosing Sturges for small datasets and switching to Freedman–Diaconis around \( n \approx 1000 \).<sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup>

Doane's formula is a direct modification of Sturges, 
\[ n_h = 1 + \log_{2}(n) + \log_{2}\!\left(1 + \frac{|g_1|}{\sigma_{g_1}}\right) \]
where \( g_1 \) is the sample skewness, and it produces better estimates for non-normal datasets by accounting for skew.<sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup>

## Use in software and practice

Sturges's rule is the default for the `breaks` argument of R's `hist()` function, with `"Scott"` and `"FD"` available as named alternatives through `nclass.scott` and `nclass.FD`.<sup>[3](https://search.r-project.org/R/refmans/graphics/help/hist.html)</sup> NumPy exposes it as the `"sturges"` option of `histogram_bin_edges`.<sup>[4](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)</sup>

In practice the rule serves as a starting point rather than a verdict. A bin count that reveals one feature can hide another: two peaks clearly separated at 15 bins can merge into one at 8, so a rule that picks 8 would suggest a unimodal distribution where the data are bimodal. Practitioners are advised to draw the histogram and check that the visible shape holds when the bin count is nudged up and down.<sup>[7](https://histogramhub.com/blog/sturges-scott-freedman-diaconis-bin-rules)</sup> A 2021 perception study comparing Sturges, Scott, Rice, and Freedman–Diaconis against human viewers found that most of these formulas overestimate the number of bins needed to make a distribution visible to a person.<sup>[9](https://arxiv.org/abs/2109.06612)</sup>

## References

1. [Herbert A. Sturges (1926). "The Choice of a Class Interval." Journal of the American Statistical Association 21: 65–66.](https://www.stat.rice.edu/~scottdw/stat550/DEMOS/09-14-hist/Sturges1926.pdf)
2. [David W. Scott (2009). "Sturges' rule." WIREs Computational Statistics 1: 303–306.](https://onlinelibrary.wiley.com/doi/full/10.1002/wics.35)
3. [R Documentation: hist {graphics}](https://search.r-project.org/R/refmans/graphics/help/hist.html)
4. [NumPy v1.15 Manual: numpy.histogram_bin_edges](https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.histogram_bin_edges.html)
5. [David W. Scott. Nonparametric Function Estimation, Chapter 3 (Stat 550A course notes, Rice University).](https://www.stat.rice.edu/~scottdw/stat550/Lectures/Chapter3.pdf)
6. [David W. Scott. Lecture notes on Sturges' rule derivation (Rice University).](https://www.stat.rice.edu/~scottdw/ss.nh.pdf)
7. [Sturges, Scott, and Freedman-Diaconis: Which Bin Rule Should You Use? Histogram Hub](https://histogramhub.com/blog/sturges-scott-freedman-diaconis-bin-rules)
8. [David W. Scott's home page, Rice University](https://www.stat.rice.edu/~scottdw/)
9. [Histogram binning revisited with a focus on human perception (arXiv:2109.06612)](https://arxiv.org/abs/2109.06612)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 11, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: Physical world and mathematics › Mathematics and statistics › Statistics and probability › Statistical inference, estimation, sampling, and testing › Foundations of statistical inference › Statistical inference: overview

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/sturgess-rule
