Frequency Distribution Calculator | Tables & Charts
Build grouped or ungrouped frequency distribution tables from raw data. Shows relative and cumulative frequencies, modal class, estimated mean and standard deviation, and a bar chart.
Press Ctrl+Enter to build table · Esc to reset
What Is the Frequency Distribution Calculator | Tables & Charts?
A frequency distribution transforms a raw list of observations into a structured table showing how often each value, or range of values, appears. It is the starting point for virtually every descriptive statistics task: before computing a mean, drawing a histogram, or fitting a probability distribution, you need to understand where your data are concentrated and how they spread.
Ungrouped vs. Grouped Distributions
- ›Ungrouped (exact-value) distribution, lists every distinct value with its exact count. Best for categorical data (grades A/B/C, responses Yes/No), small integers, or datasets with few unique values. The table answers “exactly how many times did each value appear?”
- ›Grouped (class-interval) distribution, bins continuous or wide-range numeric data into intervals (e.g., [60–70), [70–80)). Best for measurement data like heights, weights, or test scores. The table answers “how many values fall in each range?”
Choosing the Number of Classes
Too few classes hide the shape of the distribution; too many create sparse, noisy bins. Sturges' rule, k ≈ 1 + 3.322 × log₁₀(n), gives a reasonable starting point for normally-distributed data. For n = 20 it suggests 5 classes; for n = 1000 it suggests 11. Doane's formula extends Sturges' rule for skewed data, and the Freedman–Diaconis rule uses the interquartile range to determine bin width. This calculator uses Sturges by default and lets you override it for full control.
Reading a Cumulative Frequency Column
The cumulative relative frequency (ogive) at class k tells you the percentage of data at or below that class boundary. For example, a cumulative frequency of 75% at [70–80) means three-quarters of the dataset scored below 80. This is directly related to percentile rank, the value at 50% cumulative frequency is the median class.
Formula
| Symbol | Name | Description |
|---|---|---|
| f | Class frequency | Count of observations that fall within this class or equal this value |
| n | Total observations | The sum of all class frequencies; equals the original sample size |
| rf | Relative frequency | f/n, the proportion of observations in this class, usually expressed as % |
| cf | Cumulative frequency | Running total of f values from the first class up to and including the current class |
| k | Number of classes | Chosen using Sturges' rule or manually; typically 5–20 for most datasets |
| w | Class width | (Max − Min) / k, rounded up to a clean value to give neat class boundaries |
| m | Class midpoint | (Lower + Upper) / 2, used as the representative value for grouped mean/variance estimation |
How to Use
- 1Choose mode: Select Ungrouped for categorical data or text, or Grouped for continuous numeric data with class intervals.
- 2Load a preset: Click one of the sample dataset buttons to try the calculator immediately, test scores, letter grades, Likert-scale survey, or heights.
- 3Paste your data: Type or paste raw values into the text box. Separate with commas, spaces, semicolons, or newlines, any combination works.
- 4Set class count: For Grouped mode, leave the classes field blank for auto-Sturges, or enter a specific number (2–100) if you need a particular bin count.
- 5Sort (ungrouped): Choose "Value" order (alphabetical / numeric ascending) or "Frequency ↓" to rank values from most to least common.
- 6Build the table: Click Build Table or press Ctrl+Enter. Stat cards, a bar chart, and the full frequency table appear instantly.
- 7Interpret results: The modal class (highest frequency) is highlighted in orange. The cumulative column shows what percentage of data falls at or below each class.
- 8Export: Click "Copy as CSV" to copy the table to your clipboard for pasting into Excel, Google Sheets, or any statistics software.
Example Calculation
Example 1, Ungrouped: Letter Grades
A class of 20 students received the following grades: A, B, A, C, B, A, D, B, A, C, A, B, C, A, B, A, C, B, D, A.
Mode = A (8 occurrences, 40%). 90% of students received C or better.
Example 2, Grouped: Test Scores
20 test scores: 78, 85, 92, 67, 73, 88, 95, 81, 69, 76, 84, 90, 72, 88, 77, 93, 65, 82, 79, 86. Sturges suggests k = 1 + 3.322 × log₁₀(20) ≈ 5 classes. Range = 95−65 = 30, width = 30/5 = 6.
Understanding Frequency Distribution | Tables & Charts
Distribution Shapes You Can Identify
| Shape | Description | Typical context |
|---|---|---|
| Bell-shaped (Normal) | Symmetric, single peak in the middle | Heights, IQ scores, measurement errors |
| Right-skewed | Long tail to the right; most values are low | Incomes, response times, city populations |
| Left-skewed | Long tail to the left; most values are high | Exam scores with a ceiling, age at retirement |
| Uniform | All classes have roughly equal frequencies | Dice rolls, random number generators |
| Bimodal | Two distinct peaks separated by a valley | Mixed populations, e.g. adult heights by sex |
| J-shaped | Frequency rises or falls monotonically | Wealth distribution, survival curves |
From Frequency Table to Histogram
A histogram is simply a frequency distribution rendered as a bar chart, with class intervals on the x-axis and frequency (or relative frequency) on the y-axis. Unlike a regular bar chart, histogram bars touch each other, there are no gaps, because the classes are contiguous intervals, not separate categories. The area of each bar represents the proportion of data in that class.
Frequency Distribution in Practice
- ›Quality control, Pareto analysis uses frequency distributions to identify which defect categories account for the most failures (80/20 rule)
- ›Demographics, age-frequency distributions reveal population pyramids and dependency ratios
- ›Meteorology, rainfall frequency tables show how often precipitation falls in each intensity band
- ›Finance, return distributions reveal whether an investment has fat tails (higher-than-normal extreme outcomes)
- ›Education, grade distributions help teachers calibrate difficulty and identify bimodal performance (two distinct student groups)
- ›Medicine, blood pressure frequency distributions identify the proportion of a population with hypertension
Comparing Sturges, Doane, and Scott Rules
- ›Sturges (1926): k = 1 + 3.322 log₁₀(n), fast, works for n up to ~200, assumes approximate normality
- ›Doane (1976): extends Sturges with a skewness correction term, better for asymmetric data
- ›Scott (1979): w = 3.5σ/n^(1/3), minimises mean integrated squared error; optimal for normally distributed data
- ›Freedman–Diaconis (1981): w = 2·IQR/n^(1/3), robust to outliers since it uses IQR instead of standard deviation
All calculations run entirely in your browser. No data is uploaded to any server, your dataset stays on your device. Frequency counting uses exact integer arithmetic; grouped mean and standard deviation are approximated from class midpoints, which may differ slightly from the true values computed from raw data.
Frequently Asked Questions
What is the difference between frequency and relative frequency?
Frequency (f) is the raw count, the number of times a value or class appears in the dataset.
Relative frequency is f divided by the total number of observations (n), expressed as a decimal or percentage. It answers the question “what proportion of the data falls here?”
- • If 12 out of 40 students scored in [80–90), the frequency is 12 and the relative frequency is 12/40 = 30%
- • Relative frequencies are more useful when comparing datasets of different sizes
- • All relative frequencies must sum to 1.000 (or 100%)
How do I choose the number of classes for a grouped distribution?
There is no single correct answer, but the standard guidance is:
- • Use k = 1 + 3.322 × log₁₀(n) (Sturges' rule) as a starting point
- • Keep between 5 and 20 classes for most datasets
- • Fewer classes → smoother shape, but detail is lost; more classes → more detail, but individual bars may be sparse or empty
- • Adjust until the histogram reveals a clear shape without excessive noise
For small datasets (n < 20), 4–6 classes usually work well. For large datasets (n > 500), 10–20 classes are appropriate.
What does cumulative frequency tell me?
Cumulative frequency (absolute) is the running total of observations up to and including the current class. Cumulative relative frequency (%) is the corresponding proportion:
- • A cumulative relative frequency of 60% at [70–80) means 60% of the data is below 80
- • The last class always has cumulative frequency = n and cumulative relative frequency = 100%
- • Plotting cumulative relative frequency against class upper boundaries produces an ogive curve, which is used to read off percentiles
The class where cumulative frequency first reaches or exceeds 50% contains the median.
What is the modal class in a grouped frequency distribution?
The modal class is the class interval with the highest frequency. It is highlighted in the table with a ★ symbol.
- • For ungrouped data, the mode is the exact value(s) with the highest count
- • For grouped data, the modal class tells you where data are most concentrated, but the precise mode within that interval is estimated using interpolation (not done here)
- • A distribution can have two modal classes (bimodal) or more (multimodal)
The modal class is important in quality control, it reveals where defects, measurements, or responses cluster most densely.
How accurate is the mean and standard deviation from grouped data?
The mean and standard deviation shown for grouped distributions are approximations, because we represent each class with its midpoint rather than the actual individual values.
- • x̄ ≈ Σ(midpoint × f) / n, this equals the true mean when data are uniformly distributed within each class
- • The approximation error is typically <1% for well-chosen class widths
- • Wider class intervals introduce more approximation error
For exact mean and standard deviation, use the raw data values directly in a statistics calculator.
Can I build a frequency distribution for categorical (text) data?
Yes, use the Ungrouped mode. Categorical data like grades (A, B, C), survey responses (Agree, Disagree), or product categories work perfectly.
- • Values are sorted alphabetically by default, or by frequency descending using the sort toggle
- • There are no class intervals, each distinct value gets its own row
- • For categorical data, cumulative frequency is technically computed but may be less meaningful than for ordered data
Categorical frequency distributions are the basis for bar charts and Pareto charts in quality management.
What is the difference between a frequency distribution and a histogram?
A frequency distribution is a table; a histogram is a chart of that same data:
- • Both show the same information, which classes contain more or fewer observations
- • A histogram's bars are contiguous (touching) because classes represent continuous intervals
- • The area of each bar is proportional to frequency (when bars have equal width)
- • The frequency distribution table is more precise; the histogram reveals shape at a glance
This calculator shows a bar chart visualization alongside the table, the modal class bar is highlighted in orange for quick identification.
How do I interpret relative frequency for hypothesis testing?
Relative frequencies are the empirical counterpart of theoretical probabilities. They are used in:
- • Chi-square goodness-of-fit tests, compare observed relative frequencies against expected probabilities from a theoretical distribution
- • Kolmogorov–Smirnov test, compare the empirical cumulative distribution (ogive) against a theoretical CDF
- • Empirical probability estimation, use observed relative frequencies as estimates of future probabilities
For example, if 30% of 200 customers churned (relative frequency = 0.30), you can use 0.30 as an estimate of the churn probability for future customers, assuming the population is stable.