Bin Width Calculator (Scott's Rule)
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/10/2026
Scott's rule calculates an optimal bin width for a histogram with h = 3.49 × s × n^(−1/3), where s is the standard deviation of the data and n its count. For a standard deviation of 2 over 100 observations, the recommended bin width is about 1.50.
Explanation
Our Sturges' rule calculator, already published, estimates a NUMBER of bins for a histogram from the sample size alone — a simple method, but one that implicitly assumes the data approximately follows a normal distribution and tends to underestimate the optimal number of bins on large samples. Scott's rule (1979) takes a different approach in two ways: it directly calculates a bin WIDTH (h) rather than a number of bins, and above all, it accounts for the actual dispersion of the data via its standard deviation, not just its count. This accounting for dispersion has an important practical consequence: two samples of the same size n but with very different dispersions (one very concentrated around its mean, the other very spread out) will receive very different bin widths with Scott's rule, whereas Sturges' rule would assign them exactly the same number of bins, regardless of their respective dispersion. Once the width h is obtained, the corresponding number of bins follows easily by dividing the range of the data (the difference between the maximum and minimum) by that width h. Scott's rule, like Sturges', remains a reasonable starting point rather than an absolute prescription: the result obtained always benefits from being adjusted visually according to the shape of the histogram actually produced.
Example: standard deviation of 2, sample of 100 observations
Inputs
Standard deviation (s): 2. Number of observations (n): 100.
Calculation
h = 3.49 × 2 × 100^(−1/3) = 6.98 × 0.21544 ≈ 1.5038.
Result
The recommended bin width for this histogram is about 1.50.
Frequently asked questions
What is the difference between Scott's rule and Sturges' rule?
Sturges' rule depends only on the number of observations and directly gives a number of bins, implicitly assuming a near-normal distribution. Scott's rule instead gives a bin width, and accounts for the actual dispersion of the data via its standard deviation — two samples of the same size but different dispersions will receive different recommendations with Scott, identical ones with Sturges.
How do you convert the bin width into a number of bins?
Just divide the range of the data (the maximum value minus the minimum value of the sample) by the bin width h obtained, then round to the nearest whole number. A smaller bin width therefore mechanically gives a higher number of bins, and vice versa.
Why does the bin width decrease as the number of observations increases?
Because a larger sample can represent the distribution in more detail without each bin becoming too sparsely populated to be reliable: Scott's rule therefore gradually reduces the recommended width (via the −1/3 exponent on n) as more data becomes available, which produces a finer, more informative histogram.