statcompute

Descriptive statistics

Frequency Table Calculator

Turn a column of values into a frequency table — ungrouped, or grouped into classes.

Also called frequency table calculator, frequency distribution calculator, tally chart maker.

Updated August 2026Runs in your browser — nothing is uploadedVerified against R
One value per line, or separated by commas, tabs or spaces. A header row is ignored.
Tick for continuous data with many distinct values.
Leave empty to use Sturges' rule.

The calculation runs in your browser, so this box needs JavaScript. The formula, the worked example and the interpretation below do not.

01

How to read this result

Relative frequencies are the empirical probability distribution of your sample. They sum to 1 (up to rounding), and they are the best estimate of the underlying probabilities that the data alone can give.

Cumulative frequencies answer "how many at or below". They are what percentiles are computed from, and plotting them gives the empirical cumulative distribution function.

Group when there are too many distinct values to read. Continuous measurements produce a table with one row per observation, which is no summary at all. Grouping into classes trades detail for readability — and the class boundaries then matter, in the same way histogram bins do.

Grouped data loses the original values. Statistics computed from a grouped table use the class midpoints as proxies, so a mean from grouped data is an approximation. Compute summaries from the raw values when you still have them.

02

The formula

fi=countirelative=fincumulative=jifj

For grouped tables, the class width is the range divided by the number of classes, and the midpoint is the average of the class boundaries.

03

Worked example

Counting dice rolls

Thirty rolls of a die produce these results: 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 1, 2, 3, 4, 5, 6, 3, 4, 5.

  1. Count each distinct value.
    1 appears 2×, 2 appears 3×, 3 appears 5×, 4 appears 6×, 5 appears 7×, 6 appears 7×
  2. Relative frequency: divide each count by 30.
    0.067, 0.100, 0.167, 0.200, 0.233, 0.233
  3. Cumulative: add the counts as you go.
    2, 5, 10, 16, 23, 30
  4. Check the total.
    the relative frequencies sum to 1.000
distinct values 6n 30mode 5 and 6 (7 each)most common share 23.3%

A fair die would give 5 of each in 30 rolls. Whether this deviation is meaningful is a job for the chi-square goodness-of-fit test, which on these counts returns a comfortably non-significant result.

Checked against a direct count — verified against R's table.

The calculator above is loaded with these numbers by the Load the worked example button.

04

Assumptions, and when to use something else

None for the ungrouped table — it is a count. The grouped version needs a choice of class count, and that choice changes the picture: too few classes hide structure, too many turn the table into the raw data again. Sturges' rule is the default and is what most software uses.

Classes here are closed on the left and open on the right, except the last, which includes its upper bound — otherwise the maximum value would fall outside every class.

  • You want the pictureHistogram makerThe same grouping, drawn, with several bin-count rules to compare.
  • You want summary statisticsDescriptive statisticsMean, median, spread and shape from the raw values.
  • You want to test the counts against an expectationChi-square goodness of fitTests whether observed counts match a distribution you specify.
  • The data are small enough to keep the digitsStem-and-leaf plotA frequency table that keeps every original value visible.
05

Questions people ask

How many classes should a grouped frequency table have?

Sturges' rule — ⌈log₂n⌉ + 1 — is the usual default: about 6 classes for 30 values, 9 for 200. The square root rule and Freedman-Diaconis are alternatives, and the histogram maker shows what each suggests for your data.

What is relative frequency?

The count divided by the total — the proportion of observations in that category. Multiply by 100 for a percentage. Relative frequencies always sum to 1.

Can I compute the mean from a grouped frequency table?

Approximately: multiply each class midpoint by its frequency, sum, and divide by n. It is an approximation because the original values inside each class are gone — if you still have them, compute the mean from those instead.