BYTETOOLS

Frequency Distribution Calculator

Group raw data into classes using Sturges' rule, the square-root rule or a width you choose, then get frequencies, cumulative columns, grouped stats and a histogram.

Classes from the rule

k = 6

30
Values n
6
Classes k
2.67
Class width
16.00
Range

Frequency distribution table

ClassMidpointfRelative fCumulative fCum. relative
18.0020.6719.33310.00%310.00%
20.6723.3322.00620.00%930.00%
23.3326.0024.67413.33%1343.33%
26.0028.6727.33826.67%2170.00%
28.6731.3330.00620.00%2790.00%
31.3334.0032.67310.00%30100.00%

Classes are half-open [lower, upper) so no value is counted twice; the highest class is closed at the top so the maximum lands inside it. The modal class is highlighted.

Histogram

19.33: 322.00: 624.67: 427.33: 830.00: 632.67: 319.3322.0024.6727.3330.0032.67

Bars are labelled by class midpoint.

Grouped statistics

26.17778
Grouped mean (Σfm / n)
16.51903
Grouped variance
4.06436
Grouped SD
26.03333
Actual mean (raw data)
26.00 – 28.67
Modal class
26.00 – 28.67
Median class
18.00 / 34.00
Min / Max

Grouped statistics pretend every value sits at its class midpoint, so they differ slightly from the raw figures — the actual sample variance here is 17.8954 against a grouped 16.51903. Narrower classes shrink the gap.

What is the Frequency Distribution Calculator?

The ByteTools Frequency Distribution Calculator turns a list of raw numbers into a grouped frequency table.

  • Four class rules: Sturges, square root, fixed count or fixed width
  • Frequency, relative frequency and both cumulative columns
  • Grouped mean, variance and standard deviation from Σfm/n
  • Modal class and median class identified automatically
  • Histogram labelled by class midpoint with the modal class highlighted
  • Copies as tab-separated text for spreadsheets

How to use the Frequency Distribution Calculator

  1. 1

    Paste your data, separated by spaces, commas or new lines.

  2. 2

    Choose a class rule: Sturges, square root, a fixed number of classes or a fixed width.

  3. 3

    Adjust the number of decimal places shown in the table if you need to.

  4. 4

    Read the frequency table with relative and cumulative columns.

  5. 5

    Check the grouped mean, variance, modal class and histogram, then click Copy table.

About the Frequency Distribution Calculator

The ByteTools Frequency Distribution Calculator turns a list of raw numbers into a grouped frequency table. Choose how the classes are decided — Sturges' rule, the square-root rule, a fixed number of classes or a fixed class width — and the tool builds the class limits, midpoints, frequencies, relative frequencies and both cumulative columns in one pass.

Underneath the table it estimates the grouped mean using Σfm/n, along with the grouped variance and standard deviation, the modal class and the median class. The raw mean and variance are shown next to the grouped versions so you can see exactly how much accuracy the grouping cost — narrower classes shrink the gap.

A histogram labelled by class midpoint sits beside the table, and the whole table copies as tab-separated text that pastes straight into Excel, Google Sheets or a lab report. Everything is computed inside your browser, none of your data is uploaded, and the page keeps working with no connection.

Frequently asked questions

What is Sturges' rule for choosing the number of classes?

Sturges' rule sets the class count k to 1 + 3.322 × log₁₀(n), rounded up. For 100 values that gives 8 classes. It works well for moderate, roughly symmetric data sets but tends to use too few classes for very large or heavily skewed ones, where the square-root rule usually looks better.

How do you calculate the mean from a grouped frequency table?

Multiply each class midpoint by its frequency, add those products together and divide by the total number of values. This is the Σfm/n formula, and it assumes every value in a class sits exactly at the midpoint, so it is an estimate rather than the exact mean.

Why is the grouped mean slightly different from the real mean?

Grouping throws away the individual values and replaces them with class midpoints. If a class happens to hold values clustered near one end, the midpoint misrepresents them a little. The tool shows both figures side by side, and using narrower classes brings them closer together.

What is the modal class?

It is the class with the highest frequency, the grouped equivalent of the mode. It is highlighted in both the table and the histogram. With grouped data you can only identify the interval that contains the most values, not a single modal value.

How do I choose a class width?

Divide the range by the number of classes you want, then round to a convenient number such as 5 or 10 so the class limits read cleanly. Switch the tool to fixed class width mode to enter that value directly and see the resulting classes immediately.

Related tools