Histogram Calculator

Generate histograms from raw data with 5 bin methods (Sturges, Square Root, Rice, Freedman-Diaconis, custom). SVG visualization, density, skewness, and bin comparison.

Minimum 3 values
Bins
5
Width: 5.600
n
15
Range: 28.00
Mean
80.8000
SD: 9.3213
Median
81.0000
IQR: 18.0000
Modal Bin
[67.0, 72.6)
Freq: 4
Skewness
-0.064
Near symmetric

Histogram

01235467273278384489Value
--- Mean (80.8)

Bin Table

BinMidpointFreqRel FreqDensityCum Freq
[67.00, 72.60)69.80426.7%0.0476194
[72.60, 78.20)75.40213.3%0.0238106
[78.20, 83.80)81.00213.3%0.0238108
[83.80, 89.40)86.60320.0%0.03571411
[89.40, 95.00]92.20426.7%0.04761915

Bin Method Comparison

MethodFormulaBinsSelected
Sturges'1 + 3.322 log₁₀(n)5
Square Root√n4
Rice2n^(1/3)5
Freedman-Diaconisrange / (2·IQR·n^(-1/3))2
CustomUser-specified6
Planning notes, formulas, and examples

About the Histogram Calculator

The histogram calculator groups raw numbers into equal-width bins and draws the result as a bar chart. It supports Sturges, Square Root, Rice, Freedman-Diaconis, and Custom binning, so you can compare a few different ways of summarizing the same dataset.

Histograms are useful when you want to see spread, skewness, clusters, and gaps at a glance. This calculator adds density values, cumulative frequencies, and a method comparison table so you can judge whether the bin choice is helping or hiding the pattern in the data.

Use it for continuous data such as ages, test scores, times, or measurements where the distribution shape matters more than the individual raw values.

When This Page Helps

Use a histogram when you need to see how values are clustered across a range. It is one of the fastest ways to spot skewed data, a long tail, a second peak, or a suspicious gap in the middle of the distribution.

The bin comparison in this calculator is especially helpful when you are not sure whether a narrow or wide bin width gives the clearest picture.

How to Use the Inputs

  1. Enter your data as comma-separated or space-separated numbers (minimum 3 values).
  2. Select a bin-count method or use Custom to specify your own.
  3. Choose vertical or horizontal orientation for the histogram.
  4. Study the SVG chart: taller bars indicate more values in that range; the red dashed line marks the mean.
  5. Review the bin table for exact frequencies, relative frequencies, and density values.
  6. Compare bin methods in the comparison table to see which gives the best visual result.
Formula used
Sturges': k = 1 + 3.322 log₁₀(n). Freedman-Diaconis: width = 2 × IQR × n^(-1/3). Density = (relative frequency) / bin width. Pearson skewness = 3(mean − median) / SD.

Example Calculation

Result: 5 bins, width 6.0, modal bin [73, 79) with frequency 5, near-symmetric skewness

Sturges' rule gives 5 bins for 15 data points. The histogram shows data concentrated in the middle bins with a slight left skew (Pearson skewness = −0.07). The red mean line at 81.5 sits slightly left of the tallest bar.

Tips & Best Practices

  • The Freedman-Diaconis rule adapts to data spread (using IQR) and is more robust than Sturges' for skewed data.
  • Density histograms (area = 1) are needed when overlaying theoretical probability distributions (like normal curves).
  • If the histogram shape changes dramatically with different bin counts, your data may not have a clear underlying pattern.
  • Right-skewed data (long right tail) is very common: income, reaction times, and biological measurements often show this.
  • A bimodal histogram (two peaks) suggests your data may be a mixture of two distinct populations.
  • When comparing histograms of different-sized datasets, use relative frequency bars so the heights are comparable.

Choosing a Bin Method

The method you choose changes the story the histogram tells. Sturges tends to give a smaller number of bins, which works well for small datasets. Freedman-Diaconis adapts to spread through the IQR and often works better for skewed data. Custom bins are useful when you need to match an existing reporting standard.

What the Shape Tells You

A symmetric histogram suggests values are balanced around the center. A right-skewed histogram has a long tail on the high end, while a left-skewed histogram has a tail on the low end. Multiple peaks can mean the data comes from more than one subgroup.

Practical Use

Histograms are common in quality control, survey analysis, and exploratory statistics because they give a quick visual summary before you move on to more formal measures such as variance, quantiles, or density curves.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Start with Sturges' rule for small/normal data or Freedman-Diaconis for larger or skewed data. Then adjust visually: too few bins create a flat, uninformative chart; too many make it spiky. The goal is to reveal the data's shape without noise. Most real datasets work well with 5–20 bins.