Frequency Distribution Calculator

Frequency Table & Histogram from Raw Data

Paste any list of numbers — get a complete frequency distribution table with class intervals, relative frequency, cumulative frequency, and a histogram. Uses Sturges's Rule for automatic bin selection.

k = ⌈1 + 3.322 × log₁₀(n)⌉ f / n = Relative Freq Auto Bin Selection SVG Histogram Cumulative Frequency
Share this tool

Sturges's Rule automatically picks k = ⌈1 + 3.322 × log₁₀(n)⌉ classes for your dataset size.

Quick Load:

Building distribution…

Paste a list of numbers above and click Calculate to build a frequency distribution table and histogram.

What Is a Frequency Distribution?

A frequency distribution organises raw data into class intervals and counts how many values fall within each interval. Instead of staring at a long list of numbers, you see the shape of your data at a glance — where values cluster, how spread out they are, and whether the distribution is symmetric or skewed.

Frequency distributions are used across every field that works with data. Teachers use them to summarise exam scores. Healthcare researchers use them to study patient ages and measurements. Quality engineers use them to check whether manufacturing output stays within tolerance. Biologists use them to describe population sizes. Whenever you have a list of continuous measurements and want to understand their pattern, a frequency distribution is the right starting point.

This calculator accepts any list of numbers, automatically selects a suitable number of class intervals using Sturges's Rule, and produces the complete frequency table — frequency (f), relative frequency (f/n), cumulative frequency, and cumulative relative frequency — alongside a histogram.

How to Build a Frequency Distribution Table

Building a frequency distribution by hand follows six steps. The calculator automates all of them.

1

Collect your data

Write down or import all values — exam scores, heights, temperatures, response times, or any other continuous measurement.

2

Find the range

Range = Maximum − Minimum. For 20 exam scores ranging from 45 to 98: Range = 98 − 45 = 53.

3

Choose the number of classes (k)

Apply Sturges's Rule: k = ⌈1 + 3.322 × log₁₀(n)⌉. For n = 20: k = ⌈1 + 3.322 × 1.301⌉ = ⌈5.32⌉ = 6 classes.

4

Calculate class width

Width ≈ Range / k = 53 / 6 ≈ 8.8. Round up to the next nice number: 10. Always round up so no data falls outside the last class.

5

Set class boundaries and tally

Start the first class at the nearest multiple of the class width at or below the minimum: [40, 50), [50, 60), …, [90, 100]. Tally each value into its class.

6

Compute relative and cumulative frequencies

Relative frequency = f / n. Cumulative frequency adds up all frequencies from the first class to the current one. The last cumulative relative frequency must equal 1.0000.

Worked example — 20 exam scores (45–98):

ClassfRel. fCum. fCum. Rel. f
[40, 50)10.050010.0500
[50, 60)20.100030.1500
[60, 70)20.100050.2500
[70, 80)40.200090.4500
[80, 90)60.3000150.7500
[90, 100]50.2500201.0000

How Many Classes Should You Use? — Sturges's Rule

Choosing the number of classes (bins) is the most consequential decision in frequency distribution analysis. Too few classes and you lose detail — everything lumps together. Too many and every class has a frequency of 1 or 0, which tells you nothing useful.

k = ⌈ 1 + 3.322 × log₁₀(n) ⌉

where n = number of data points and ⌈ ⌉ denotes the ceiling function

Sturges's Rule (1926) derives the optimal class count from the assumption that the data follow a roughly normal distribution. The formula comes from the maximum number of classes that can carry meaning for a dataset of size n when expressed in binary — roughly log₂(n) + 1. The factor 3.322 converts log₂ to log₁₀.

Dataset size (n)Sturges's kTypical use case
10–205–6Small surveys, classroom tests
20–506–7Lab experiments, quality checks
50–1007–8Medical measurements, survey responses
100–5008–10National survey samples, factory output
500–1,00010–11Large datasets, census subgroups

Sturges's Rule is a starting point, not a law. If your data are heavily skewed, bimodal, or very large (> 1,000 values), you may get better results with the Freedman–Diaconis rule or by choosing the bin count manually using the selector above.

Relative Frequency vs Cumulative Frequency

Relative Frequency (f/n)

Divides each class frequency by the total number of values. The result is a proportion between 0 and 1 (or a percentage if multiplied by 100). All relative frequencies must sum to 1.0000.

Relative freq = f ÷ n

Use when comparing datasets of different sizes — a class with f=6 out of n=20 (30%) is easier to compare with another dataset than the raw count of 6.

Cumulative Frequency

Adds up frequencies from the first class through each successive class. The last cumulative frequency always equals n (total values). Cumulative relative frequency ends at exactly 1.0000.

Cum. freq = sum of f up to this class

Use for answering questions like "what percentage of students scored below 70?" — read the cumulative relative frequency at the [60, 70) boundary.

The ogive (cumulative frequency graph) plots cumulative frequency against class upper boundaries. It shows the percentile rank of any value — a useful companion to the histogram for understanding data spread.

How to Draw a Histogram

A histogram is a bar chart where the bars represent continuous class intervals. The key feature that distinguishes a histogram from an ordinary bar chart is that the bars touch — there are no gaps between them. This signals that the data are continuous, not categorical.

Histogram (continuous data)

  • Bars touch — no gaps
  • X-axis shows class intervals (ranges)
  • Y-axis shows frequency (or density)
  • Bar width = class width
  • Used for: heights, ages, temperatures, scores

Bar Chart (categorical data)

  • Gaps between bars
  • X-axis shows distinct categories
  • Y-axis shows frequency or count
  • Bar widths can vary
  • Used for: favourite colours, exam grades (A/B/C), survey options

When interpreting a histogram, look for the overall shape: a symmetric bell curve suggests a normal distribution; a right-skewed shape (long tail on the right) is common in income and waiting-time data; a left-skewed shape appears in test scores with an easy exam (most scores cluster near the top). A bimodal shape (two peaks) may indicate two distinct subgroups in your data.

Visual Guide: From Raw Data to Histogram

Follow a dataset of 20 exam scores through every step of frequency distribution construction.

1

Raw Data (n=20)

45, 52, 58, 61, 67, 71, 73, 74, 78, 81, 83, 85, 87, 88, 89, 90, 92, 95, 97, 98

2

Sort & Range → Sturges k=6 → Class width=10

3

Frequencies: 1, 2, 2, 4, 6, 5

[40,50) [50,60) [60,70) [70,80) [80,90) [90,100]

Frequency Distribution FAQ

What is a frequency distribution table?

A frequency distribution table organises raw data into non-overlapping class intervals and shows how many values (the frequency) fall into each interval. It also typically shows relative frequency (frequency as a proportion of total) and cumulative frequency (running total from the first class). The table reveals the shape, centre, and spread of your data in a structured format.

How do I choose the number of classes for a frequency distribution?

The most common guideline is Sturges's Rule: k = ⌈1 + 3.322 × log₁₀(n)⌉, where n is the number of data points. For 20 values this gives 6 classes; for 100 values, about 8. As a rough rule of thumb: use 5–7 classes for small datasets (n < 30), 7–10 for medium (30–200), and 10–15 for larger ones. Adjust manually if the default leaves important patterns hidden.

What is Sturges's Rule?

Sturges's Rule is a formula from 1926 that recommends the number of classes k = ⌈1 + 3.322 × log₁₀(n)⌉ for a dataset of n values. It is derived from the assumption that the data are approximately normally distributed. The formula works well for samples between 30 and 500 values but can suggest too few classes for very large datasets or non-normal distributions. Alternative rules include Scott's rule (uses standard deviation) and the Freedman–Diaconis rule (uses IQR).

What is the difference between relative frequency and cumulative frequency?

Relative frequency is each class's share of the total: f ÷ n. All relative frequencies sum to 1. It is useful when comparing datasets of different sizes. Cumulative frequency is the running total of frequencies from the first class to the current one. It tells you how many values are at or below a given point. Cumulative relative frequency (the proportion version) reaches exactly 1.0000 in the last class.

What is the difference between a histogram and a bar chart?

In a histogram, bars represent continuous numeric intervals and touch each other — no gaps. The x-axis is a continuous number line. In a bar chart, bars represent distinct categories (e.g. colours, grades, countries) and gaps between bars indicate they are separate categories. If you are displaying frequency distribution data for measurements like height or test scores, use a histogram. If you are displaying categorical counts, use a bar chart.

How do I calculate class width?

Class width ≈ Range ÷ k, where Range = max − min and k = number of classes from Sturges's Rule. Always round up to the next "nice" number (5, 10, 25, etc.) to ensure clean boundaries and to guarantee all data points fall within a class. Never round down — rounding down risks leaving the maximum value outside the last class boundary.

Can I use a frequency distribution for non-numeric data?

The standard frequency distribution with class intervals applies to continuous numerical data. For categorical data (e.g. blood types, favourite colours), you can create a simple frequency table that lists each category and its count — but there are no class intervals or class width, and the result is displayed as a bar chart rather than a histogram. This calculator handles numeric data only.

Related Calculators