Histogram Hub

Sturges, Scott, and Freedman-Diaconis: Which Bin Rule Should You Use?

July 12, 2026

A histogram is only as honest as its bins. Use too few and real structure gets smoothed away into a single bland hump. Use too many and random noise starts to look like meaningful bumps. Somewhere in between is a bin count that shows the shape of your data without inventing detail, and the whole job of a bin rule is to land you near that count without guesswork.

There are three rules you will meet again and again: Sturges, Scott, and Freedman-Diaconis. They do not agree, and that is the point. Each was built on a different assumption about your data, so the right one depends on what your data looks like. This guide covers what each rule does, where it shines, and where it quietly misleads you.

What a bin rule is really choosing

The rules split into two families, and it helps to know which kind you are using.

Some rules pick a bin count directly. You feed in the number of data points and they hand back how many bars to draw. Sturges works this way. Other rules pick a bin width instead. They estimate how wide each bar should be, and the count falls out of the range of your data divided by that width. Scott and Freedman-Diaconis work this way, which is why they react to how spread out your numbers are, not just how many you have.

That difference is the whole story. A count-based rule ignores spread, so one wild outlier does not change the number of bins. A width-based rule notices spread, so it adapts to the actual shape of the data, for better and sometimes for worse.

Sturges: the old default

Sturges is the rule most software reaches for out of the box. It sets the number of bins from the sample size alone:

k = 1 + log2(n)

For 100 points that gives about 8 bins, for 1,000 points about 11. The formula is simple and it feels reasonable, which is why it became the default in a generation of stats tools.

The problem is the assumption hiding inside it. Sturges was derived from an idealized bell curve, so it works best when your data is roughly normal and modest in size. Feed it a large dataset and it under-bins badly, smoothing real features into a blur, because the log term grows too slowly to keep up. Feed it skewed data and it ignores the skew entirely, since it never looks at spread at all. Sturges is a fine starting point for small, tidy, roughly symmetric samples, and a poor choice for anything large or lopsided.

Scott: tuned for normal data

Scott's rule picks a bin width instead of a count, and it uses the standard deviation to do it:

h = 3.49 × σ × n^(-1/3)

Here σ is the standard deviation and n is the sample size. Because it scales with spread, Scott adapts to how wide your data actually is, and the cube-root term means the bins get sensibly narrower as you collect more data. For data that really is close to normal, Scott is often the best-looking choice of the three.

Its weakness is the standard deviation itself. A few extreme outliers inflate σ, which widens every bin, which can flatten the whole histogram just because one value was far out. So Scott is a strong pick when your data is roughly bell-shaped and free of wild outliers, and a risky one when it is not. If you are not sure what shape you are dealing with, the guide on reading a histogram's shape is a quick way to tell.

Freedman-Diaconis: built for messy data

Freedman-Diaconis also picks a width, but it swaps the standard deviation for the interquartile range:

h = 2 × IQR × n^(-1/3)

The IQR is the distance between the 25th and 75th percentiles, which covers the middle half of your data and ignores the extremes. That single change makes the rule robust. One or two outliers barely move the IQR, so they barely move your bins, and the histogram keeps its shape instead of collapsing.

That robustness is why Freedman-Diaconis is the safest general-purpose rule, and the one many statisticians default to for real-world data. It handles skew and outliers gracefully, which describes most datasets you actually meet. Its only real downside is that on small samples it can produce more bins than you want, since the IQR of a handful of points is a shaky estimate. For anything from a few dozen points up, though, it is hard to go wrong with it.

Side by side

Here is the short version, the one worth keeping.

RuleChoosesAssumesBest whenStruggles when
SturgesBin countNormal, small nSmall, tidy, symmetric dataLarge or skewed data
ScottBin widthNormal, no outliersRoughly bell-shaped dataOutliers inflate the width
Freedman-DiaconisBin widthNothing about shapeSkewed or outlier-heavy dataVery small samples

Notice that two of the three assume something about your data before they run. Only Freedman-Diaconis makes no bet on shape, which is exactly why it travels well.

Do not just trust the rule

Here is the part the formulas will not tell you: no rule is right for every question. A bin count that reveals one feature can hide another. Two peaks that show up clearly at 15 bins can merge into one at 8, so a rule that picks 8 would have you conclude your data is unimodal when it is really bimodal. The rule is a starting point, not a verdict.

The honest workflow is to start with a rule and then look. Pick Freedman-Diaconis if you are unsure, draw the histogram, and then nudge the bin count up and down by hand to see whether the shape holds. If a feature survives across a range of bin counts, it is real. If it appears at one setting and vanishes at the next, it was probably noise.

That is exactly why the histogram maker lets you switch binning methods live and drag the bin count yourself, instead of locking you into whatever one rule decided. Load your numbers, flip between Sturges, Scott, Freedman-Diaconis, and manual, and watch the shape respond. The rule that keeps the picture stable is the one to trust for that dataset. For the broader question of how many bars is too many, the piece on how many bins a histogram should have covers the reasoning behind the count itself.

The one-line answer

If you want a single rule to reach for, use Freedman-Diaconis, because it makes no assumption about shape and shrugs off outliers. Use Scott when you already know your data is roughly normal and clean. Keep Sturges for small, tidy samples and treat its number as a floor, not a ceiling. Then, whichever you pick, drag the bins yourself in the histogram maker and let the data, not the formula, have the final say.