Frequency Distribution Calculator

Enter a data set and a number of classes to build a frequency distribution.

How it is calculated

values is a list of numbers separated by spaces or commas (decimals use a dot) and classes is how many equal-width classes you want: a whole number from 1 to 1000. A fractional class count such as 2.5 shows no result.

range = max − min
width = range ÷ classes, rounded up to a whole number when every value is a whole number
class index = floor((value − min) ÷ width)

Class 1 starts at the minimum, and each class takes values from its start up to, but not including, the start of the next. The largest value always goes in the last class. The result is one count per class plus the width, range, minimum and maximum. Decimal data keeps its exact width (0.8 ÷ 4 = 0.2). If all values are equal, any item is not a number, or the list is empty, there is no result.

Worked example

Fifteen test scores from 45 to 96, in 6 classes. Range: 96 − 45 = 51. Width: 51 ÷ 6 = 8.5, and because the data are whole numbers it is rounded up to 9. The classes start at 45, 54, 63, 72, 81 and 90. Counting: 45 and 52 fall in the first; 58 and 61 in the second; 63, 67 and 70 in the third; 72, 75 and 78 in the fourth; 81, 84 and 88 in the fifth; 90 and 96 in the sixth. Counts: 2, 2, 3, 3, 3, 2, which add up to 15.

Try this example →

Common mistakes

  • Expecting the tool to print class boundaries. It reports only the counts and the width, so work the boundaries out yourself: start at the minimum and add the width each time.
  • Entering decimals with a comma, such as 2,5. A comma is a separator, so it reads as the two values 2 and 5; always use a dot.
  • Entering a fractional or zero number of classes. The class count must be a whole number of at least 1, otherwise there is no result.
  • Thinking the last class ends exactly at the maximum. With whole-number data the width is rounded up, so the final class can extend past the largest value and some classes can end up empty.
  • Choosing too many classes for a small data set. With 15 values and 12 classes most classes hold one or none, and the pattern is lost.

About this calculator

A frequency distribution organizes raw, unsorted data into a manageable summary by splitting the full range of values into a chosen number of equal-width classes (or 'bins') and counting how many observations fall into each one. A data set of exam scores from 40 to 98, split into 6 classes, would produce class widths of about 10 points each, with a count of how many students scored in each range.

This grouping step is the foundation of the histogram — the classic chart used to visualize the shape of a data set's spread — and it is one of the very first techniques taught in introductory statistics because it turns an unreadable list of hundreds of individual numbers into a compact table that reveals patterns like skew, clustering, or outliers at a glance. Businesses use frequency distributions to summarize survey responses or transaction amounts, and quality control teams use them to see how measurements cluster around a target specification.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators