The Sturges' Rule Calculator

The Sturges’ Rule is a formula used to get the optimal number of bins you should use when making a histogram given a certain number of sample size.

The formula is as follows:

OB = [log₂n + 1]

Where OB is the optimal number of bins and n is the sample size.

You need to provide the sample size and hit the ‘Calculate’ button below:

OB = 8

The result is usually rounded to the nearest integer.

I hope this calculator is useful. Happy analyzing!

Take your skills to the next level ⚡️

I'm sending out an occasional email with the latest tutorials on programming, web development, and statistics. Drop your email in the box below and I'll send new stuff straight into your inbox!

No spam. Unsubscribe anytime.