Relative Frequency Calculator
Paste raw data or a frequency table to get relative frequency, percent, cumulative frequency and cumulative relative frequency for each value, with charts.
Relative Frequency Calculator
Calculate relative frequencies, cumulative frequencies, and percentages for datasets. Visualize frequency distributions with tables, bar charts, and pie charts. Perfect for statistical analysis and data presentation.
Data Input Method
Enter Data Items
Relative Frequency Calculator
A relative frequency calculator does not do one thing. The biggest mistake is treating it as a single-event f/n tool - one value in, one decimal out. That version is useless for real data work. A proper relative frequency calculator builds the whole table from your raw data: every unique value, its frequency, its relative frequency as a decimal and a percentage, and cumulative columns that let you read off percentiles at a glance. It also handles three input methods - manual entry, pasting a frequency table, or dumping a raw list - and draws bar and pie charts of the distribution.
- Relative Frequency Formula: Relative frequency = f / n, where f is the frequency of a specific value and n is the total number of observations.
- Sum of All Relative Frequencies: Always equals 1.0 (or 100%). This is a logical necessity, not a convention.
- Cumulative Relative Frequency: The running total of relative frequencies up to and including the current value. The final cumulative value must equal 1.0.
- Input Methods: Manual entry (value-frequency pairs), frequency table paste (one value-frequency pair per line), or raw data list (comma, line, or space separated).
How to Use the Calculator: Three Input Methods
Choose how to feed data in based on what you already have. The three methods cover almost every situation you will face in a middle-school or introductory college statistics course.
Manual Entry
Use this when you have a short list of categories and their counts, for example "Red: 5, Blue: 3, Green: 7". You add each value and its frequency one row at a time. The calculator merges any duplicate values - if you type "Red" twice with different frequencies, it adds them together. This method is best for small datasets under about twenty rows.
Frequency Table Input
Paste a pre-made table of value-frequency pairs, one pair per line, separated by a comma. The format is: Red, 5. A line with "Red, 5" loads correctly; a line with "5, 2.5" throws an error because the frequency must be a positive whole number. This method is fastest when you already have counts in a spreadsheet and want to copy them directly without reformatting.
Raw Data List
Paste or type all raw data values separated by commas, line breaks, or spaces. The calculator counts how often each unique value appears. If your list contains commas or line breaks (for example "New York, Los Angeles, Chicago"), it splits on those. If your list has no commas or line breaks - just spaces - it splits on spaces. This means a value like "New York" stays together as a single category when commas are present, but breaks into two words if entered without commas. For safety, always use commas or line breaks to separate values that contain spaces.
The Formula: Relative Frequency = f / n
OpenStax Introductory Statistics 2e, section 1.3, defines relative frequency exactly as frequency / total number of observations. The formula is: Relative Frequency = f / n. The numerator f is how many times a specific value appears in your dataset. The denominator n is the total number of observations - the sum of all frequencies. This ratio always falls between 0 and 1, and the sum of all relative frequencies in a complete table must equal 1.
In the calculator, the denominator n appears at the top of the results as the Total Count. Every relative frequency in the column divides its row's frequency by that same n. A common error is to use a subtotal - for example, only the row total in a two-way table - instead of n. That produces a conditional relative frequency, not a marginal one, and the column will not sum to 1.
Reading the Table: Relative, Percent, and Cumulative Columns
The output table shows five or six columns, depending on whether you toggle cumulative columns on. The core columns are:
Frequency (f)
The raw count: how many times that value appeared in the dataset. This number is always a whole integer.
Relative Frequency
The proportion of the total that this value represents, as a decimal between 0 and 1. For example, a relative frequency of 0.294 means this value accounts for 29.4% of the dataset.
Percentage (%)
The relative frequency multiplied by 100. This is the same proportion in a format that is easier to read in reports and presentations.
Cumulative Frequency
Shown only when the toggle is on. This is the running total of all raw frequencies up to and including the current row. The last cumulative frequency equals n.
Cumulative Relative Frequency
Shown only when the toggle is on. The running total of relative frequencies. The final cumulative relative frequency must be exactly 1.0. If it is not, rounding error has crept in - the calculator rounds only the displayed values, not the intermediate calculations, but the rounded sum in the table may still be slightly off. The results note warns you when this happens.
Cumulative columns are meaningful only for ordinal or numeric data. For nominal categories like "Red, Blue, Green", a cumulative total has no sensible interpretation. The calculator still shows them if toggled on, so only enable them when your data has a natural order.
Worked Example: Color Preferences of 17 People
Consider a dataset of color preferences: Red appears 5 times, Blue 3, Green 7, Yellow 2. Total observations n = 5 + 3 + 7 + 2 = 17. The relative frequency of Red is 5/17 ≈ 0.294, or 29.4%. Green, at 7/17 ≈ 0.412 or 41.2%, is the most frequent category and the mode. The sum of all relative frequencies is 1.0. The cumulative relative frequency after Red is 0.294; after adding Blue it becomes 0.294 + 0.176 = 0.470; and after the last row (Yellow) it reaches 1.0.
To run this through the calculator, use the frequency table input method and paste: Red, 5 on one line, Blue, 3 on the next, and so on. Click Calculate Frequencies. The table shows each category's frequency, relative frequency, and percentage. Toggle cumulative columns on to see the running totals. The bar chart displays the frequency distribution with value labels on the x-axis; the pie chart shows each category's slice of the total.
This same process works for any dataset, whether categorical or numeric. For numeric data like test scores (e.g., 85, 92, 78), the calculator treats each unique number as a separate value. If you need bins - ranges like 70-79, 80-89 - you must create those bins manually before entering the data, because the calculator does not accept pre-binned ranges. OpenStax chapter 2 covers binning in detail for continuous data.
| Value/Category | Frequency (f) | Relative Frequency | Percentage (%) | Cumulative Frequency | Cumulative Relative Frequency |
|---|---|---|---|---|---|
| Red | 5 | 0.294 | 29.4% | 5 | 0.294 |
| Blue | 3 | 0.176 | 17.6% | 8 | 0.470 |
| Green | 7 | 0.412 | 41.2% | 15 | 0.882 |
| Yellow | 2 | 0.118 | 11.8% | 17 | 1.000 |
| Total | 17 | 1.000 | 100.0% | — | — |
Honest Caveat: The Calculator Is a Summarizer, Not an Inference Machine
The relative frequency calculator builds the table and draws the charts. It does not compute confidence intervals, test hypotheses, or tell you whether the distribution you see is likely to occur again. The most common failure is to use the relative frequency from a small dataset - say, 20 coin flips - as a precise estimate of the true probability. It is not. The law of large numbers says the estimate improves as n grows, but for n under 50, treat the relative frequencies as rough descriptions of the sample, not reliable predictions of the next draw. A student who reports "the probability of heads is exactly 0.45" from a 20-flip sample is over-interpreting. The correct statement is "in my sample of 20 flips, heads appeared 45% of the time." The calculator helps you describe what happened. It does not tell you what will happen.
Common Questions
Why does my cumulative relative frequency column not end at exactly 1.00?
Rounding error. The calculator rounds each relative frequency to the number of decimal places you set. When the rounded values are added, the sum can be 0.99 or 1.01. The exact values, before rounding, always sum to 1. The results section includes a note when this happens. To avoid it, use more decimal places or report the unrounded sum from the calculator.
What is the difference between the relative frequency I get here and the probability in my textbook?
Relative frequency describes past data from your sample. Probability predicts future outcomes for the whole population. As the sample size n grows, relative frequency approaches the theoretical probability - this is the law of large numbers. For small datasets, do not treat relative frequency as the true probability; it is just a description of what you observed.
Can I use this calculator for a two-way table?
The calculator builds a frequency table for one variable at a time. It does not accept a matrix of counts with multiple rows and columns. For a two-way table, you would enter each combination of categories as a separate value (e.g., "Male-Red") and its frequency. The calculator will then compute joint relative frequencies (each cell divided by grand total) but not conditional relative frequencies (cell divided by row or column total). You must calculate those by hand or use spreadsheet functions like COUNTIF.
What should I do if my total n is zero?
Relative frequency is undefined for an empty dataset. The calculator throws an error saying "Total frequency is zero." You cannot calculate a proportion of nothing. Add at least one valid data entry with a positive frequency.
How many decimal places should I use?
For homework, match the precision your instructor specifies. As a rule of thumb, use one more decimal place than your raw data has. For survey percentages with small samples (n under 100), two decimal places is standard. The calculator offers 1 to 4 decimal places. Using more than 4 is rarely necessary and can give a false sense of precision.