Beginner

Frequency Distribution Calculator — Histogram & Class Frequencies

Paste your data, choose the number of classes, and get a complete grouped frequency distribution — class boundaries, counts, relative and cumulative frequencies.
Sturges' rule suggests k ≈ 1 + 3.32 × log₁₀(n)
Class width
6

Range divided by the number of classes

Data count (n)
15
Minimum
12
Maximum
42
Range
30
Number of classes
5
Modal class
18 – 24 (4)
12 – 182 (13.3%)
18 – 244 (26.7%)
24 – 304 (26.7%)
30 – 363 (20%)
36 – 422 (13.3%)
Step by step
  1. 1

    Range

    42 − 12 = 30
  2. 2

    Class width

    30 ÷ 5 = 6
    Equal class width = (max − min) / k.
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Class width = (max − min) / k; each class is a half-open interval [lower, upper). Count how many data points fall in each class; relative frequency = count/n × 100%; cumulative frequency = running total. Sturges' rule suggests k ≈ 1 + 3.32 × log₁₀(n) as a starting point for number of classes.

Formula
Class width = (max − min) / k • Relative frequency = (class count / n) × 100% • Cumulative frequency = running total of counts
How this is calculated

A grouped frequency distribution organises a large data set into a smaller number of equal-width intervals called classes or bins, making it easy to see the shape of the distribution at a glance. The calculator first finds the minimum and maximum of your data to determine the range, then divides the range by the number of classes k to get the class width. Class boundaries are computed as: class i runs from min + (i − 1) × width to min + i × width, with the last class being closed on both ends to capture the maximum value.

Each data value is assigned to the class whose lower boundary is ≤ value < upper boundary. The count for each class is tallied, the relative frequency is the count as a percentage of total observations n, and the cumulative frequency is the running sum of counts from the first class through that class. The modal class is the one with the highest count.

Choosing k: a common rule of thumb is Sturges' formula k ≈ 1 + 3.32 × log₁₀(n), which gives roughly 4–8 classes for most data sets up to a few hundred points. For very skewed distributions or smaller data sets, fewer classes may show the shape more clearly; for large data sets more classes reveal more detail. Equal class widths are used throughout — this calculator does not support unequal widths.

Frequently asked questions

Sturges' rule — k ≈ 1 + 3.32 × log₁₀(n) — is a popular starting point and is shown in the field hint. Scott's rule and the Freedman–Diaconis estimator are more sophisticated alternatives for skewed data. In practice, try 5–10 classes for most data sets and adjust until the histogram shape is informative without being too jagged or too smooth.

Relative frequency is the proportion (or percentage) of the total data that falls in each class — count / n × 100%. It lets you compare distributions with different total sample sizes on the same scale. Summing all relative frequencies gives 100%.

Cumulative frequency is the running total of counts from the first class through the current one. The final class always equals n (the total count). It is used to answer questions like "how many values are below X?" and to draw ogive (cumulative frequency) curves. Relative cumulative frequency (each value ÷ n) gives the empirical CDF.

Also known as

frequency distribution calculator
grouped frequency table statistics
class width histogram calculator
relative frequency percentage calculator
cumulative frequency distribution
frequency distribution class boundaries
histogram bin frequency count statistics
sturges rule class intervals

APA

TG we-Calculate Editorial Team. (2026). Frequency Distribution Calculator — Histogram & Class Frequencies [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/frequency-distribution-calculator

Chicago

TG we-Calculate Editorial Team. "Frequency Distribution Calculator — Histogram & Class Frequencies." TG we-Calculate. 2026. https://we-calculate.com/calculator/frequency-distribution-calculator.

IEEE

TG we-Calculate Editorial Team, "Frequency Distribution Calculator — Histogram & Class Frequencies," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/frequency-distribution-calculator

BibTeX

@misc{wecalculate_frequency_distribution_calculator, title = {Frequency Distribution Calculator — Histogram & Class Frequencies}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/frequency-distribution-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?