Frequency Polygon Calculator

Draw a frequency polygon and compute mean, standard deviation, modal class, and median class from grouped data or raw values.

📈 Frequency Polygon Calculator
Midpoints (comma-separated, ascending)
Frequencies (one per midpoint)
Raw data values (comma-separated)
Number of classes
220
Mean
Std Dev
Total (N)
Modal Class Midpoint
Median Class Midpoint

📈 What is the Frequency Polygon Calculator?

A frequency polygon is a line graph drawn by plotting class midpoints on the x-axis against their frequencies on the y-axis, then connecting the points with straight line segments. The polygon is extended to zero on both ends, one class width before the first midpoint and one class width after the last, so the shape closes on the x-axis. This calculator draws the polygon automatically and computes key grouped-data statistics: mean, standard deviation, modal class midpoint, and median class midpoint.

Frequency polygons are used in many contexts. In education, teachers plot exam score distributions to compare class performance across terms or sections. In business analytics, analysts visualize sales volume by price range or customer age bracket. In public health, epidemiologists plot disease incidence by age group to identify high-risk populations. In quality control, engineers plot defect frequencies by cause category to prioritize corrective action. The primary advantage over a histogram is that multiple frequency polygons can be overlaid on the same chart without bars blocking each other, making comparisons much easier to read.

The two input modes cover the most common workflows. From Frequency Table mode accepts pre-computed midpoints and their frequencies, which is the format used in most textbooks and spreadsheet outputs. From Raw Data mode accepts individual data points and automatically groups them into equal-width classes using Sturges-style selection, computes midpoints, and builds the polygon. This is useful when you have raw survey responses or measurements that have not yet been grouped.

A common point of confusion is the difference between the modal class and the arithmetic mode. The modal class midpoint is simply the midpoint of the class with the highest frequency. For a bell-shaped distribution, this will be close to the mean and median. For a skewed distribution, the three values diverge, and the polygon will show a visible asymmetry with a longer tail on one side. Reading the shape of the polygon tells you at a glance whether your data is symmetric, left-skewed, right-skewed, or bimodal.

📐 Formulas

Mean = ∑(fi × mi) ÷ ∑fi
mi = midpoint of class i = (lower limit + upper limit) ÷ 2
fi = frequency of class i
N = ∑fi = total number of observations
Example: midpoints 10-50, frequencies 5,12,18,10,5: Mean = (50+240+540+400+250)/50 = 29.6
SD = √[∑fi(mi − x̄)² ÷ N]
= grouped mean computed above
This is the population standard deviation for the grouped frequency data
Example: variance = 123.84, SD = √123.84 ≈ 11.13
Modal Class Midpoint = midpoint with highest frequency
Median Class Midpoint = midpoint of class where cumulative frequency ≥ N/2
Example: for N=50, find class where cumF ≥ 25. cumF at class 3 = 35 ≥ 25, so median midpoint = 30

📖 How to Use This Calculator

Steps

1
Enter midpoints and frequencies - In From Frequency Table mode, type the class midpoints as comma-separated values (e.g., 10, 20, 30, 40, 50) and the matching frequencies on the next line (e.g., 5, 12, 18, 10, 5). Both lists must have the same count and midpoints must be ascending.
2
Choose From Raw Data for ungrouped values - Switch to From Raw Data mode and paste your comma-separated data values. Adjust the number of classes with the slider (2 to 20). The calculator builds equal-width class intervals and computes midpoints automatically.
3
Read the polygon chart and statistics - The SVG frequency polygon appears above a summary table showing midpoint, frequency, relative frequency, cumulative frequency, and cumulative relative frequency. The statistics grid shows mean, SD, total N, modal class midpoint, and median class midpoint.

💡 Example Calculations

Example 1 - Exam Score Distribution

A class of 50 students sat an exam. Grouped scores: midpoints 10, 20, 30, 40, 50 with frequencies 5, 12, 18, 10, 5. Find the mean and standard deviation.

1
N = 5+12+18+10+5 = 50. Mean = (5×10 + 12×20 + 18×30 + 10×40 + 5×50) / 50 = (50+240+540+400+250)/50 = 1480/50 = 29.6.
2
Variance = [5×(10-29.6)² + 12×(20-29.6)² + 18×(30-29.6)² + 10×(40-29.6)² + 5×(50-29.6)²] / 50 = 6192 / 50 = 123.84. SD = √123.84 ≈ 11.13.
3
Modal class midpoint = 30 (highest frequency 18). Cumulative frequencies: 5, 17, 35. Since N/2 = 25 and cumF at class 3 is 35 ≥ 25, median class midpoint = 30.
Mean = 29.6, SD ≈ 11.13, Modal and Median class = 30
Try this example →

Example 2 - Monthly Rainfall by Category

40 months of rainfall data grouped into 5 classes with midpoints 20, 40, 60, 80, 100 mm and frequencies 3, 8, 14, 10, 5.

1
N = 3+8+14+10+5 = 40. Mean = (3×20 + 8×40 + 14×60 + 10×80 + 5×100) / 40 = (60+320+840+800+500)/40 = 2520/40 = 63.
2
Variance = [3×(20-63)² + 8×(40-63)² + 14×(60-63)² + 10×(80-63)² + 5×(100-63)²] / 40 = [5547+4232+126+2890+6845]/40 = 19640/40 = 491. SD = √491 ≈ 22.16.
3
Modal class midpoint = 60 (highest frequency 14). Cumulative frequencies: 3, 11, 25. N/2 = 20 and cumF at class 3 is 25 ≥ 20, so median class midpoint = 60.
Mean = 63 mm, SD ≈ 22.16, Modal class = Median class = 60
Try this example →

Example 3 - Grouped Test Scores (Four Classes)

30 students took a standardized test. Grouped scores with class midpoints 30, 50, 70, 90 and frequencies 4, 9, 11, 6.

1
N = 4+9+11+6 = 30. Mean = (4×30 + 9×50 + 11×70 + 6×90) / 30 = (120+450+770+540)/30 = 1880/30 ≈ 62.67.
2
Variance = [4×(30-62.67)² + 9×(50-62.67)² + 11×(70-62.67)² + 6×(90-62.67)²] / 30 ≈ [4259+1447+592+4480]/30 ≈ 359.3. SD ≈ 18.96.
3
Modal class midpoint = 70 (highest frequency 11). Cumulative frequencies: 4, 13, 24. N/2 = 15 and cumF at class 3 is 24 ≥ 15, so median class midpoint = 70. The polygon is slightly left-skewed since the mean (62.67) is below the mode (70).
Mean ≈ 62.67, Modal class = Median class = 70, SD ≈ 18.96
Try this example →

❓ Frequently Asked Questions

What is a frequency polygon?+
A frequency polygon is a line graph used to represent a frequency distribution. It is created by plotting points at the midpoint of each class interval (x-axis) against the corresponding frequency (y-axis), then connecting consecutive points with straight lines. The polygon extends to the x-axis one class-width before the first point and one class-width after the last point, forming a closed shape. It is commonly used in statistics to visualize the shape of a distribution and compare multiple datasets.
How is a frequency polygon different from a histogram?+
A histogram uses filled rectangular bars to show frequency for each class interval. A frequency polygon uses a line connecting midpoints of those bars. Both convey the same information, but frequency polygons are preferred when overlaying two or more distributions on the same graph because lines do not block each other the way bars do. Frequency polygons also more clearly show the overall shape and trend of the distribution.
How do you find the midpoint of a class interval?+
Midpoint = (lower class limit + upper class limit) / 2. For the class 20 to 30, midpoint = (20+30)/2 = 25. For 100 to 120, midpoint = (100+120)/2 = 110. Midpoints are the representative x-values plotted on the frequency polygon. They are also used in the mean and standard deviation formulas for grouped data.
What is the formula for the mean from grouped data?+
Mean = sum(f_i * m_i) / sum(f_i), where m_i is the midpoint of each class and f_i is the frequency. This is an approximation because the midpoint assumes all observations in a class equal the midpoint, which is rarely exactly true. For midpoints 10, 20, 30, 40, 50 with frequencies 5, 12, 18, 10, 5: Mean = 1480/50 = 29.6.
What is the standard deviation for grouped data?+
Population SD from grouped data = sqrt[sum(f_i * (m_i - mean)^2) / N], where N = total frequency. This calculator uses the population (not sample) formula since grouped data is typically a complete tabulated distribution rather than a sample. For the exam score example with midpoints 10-50 and frequencies 5,12,18,10,5: variance = 123.84, SD = 11.13.
What is the modal class in a frequency polygon?+
The modal class is the class interval with the highest frequency. Its midpoint is the mode estimate for the grouped data. On the polygon, it appears as the highest peak. For midpoints 10, 20, 30, 40, 50 with frequencies 5, 12, 18, 10, 5, the modal class midpoint is 30. When two classes tie for highest frequency, the data is bimodal.
What is the median class in a frequency polygon?+
The median class is the class where the cumulative frequency first reaches or exceeds N/2. For N = 50, you look for the class where the running total of frequencies reaches 25. If cumulative frequencies are 5, 17, 35, the third class (cumF = 35) is the median class. Its midpoint is the grouped median estimate. For a more precise median, use interpolation within the class interval.
How many classes should a frequency polygon have?+
Between 5 and 15 classes typically works best. Sturges' rule suggests k = 1 + 3.322 * log10(n) for n observations. For n = 50, k = 1 + 3.322 * log10(50) = about 7 classes. Too few classes (3 or 4) hide important shape features. Too many classes (20 or more) produce a jagged polygon with many zero-frequency spikes.
What does the shape of a frequency polygon tell you?+
A symmetric bell shape suggests a roughly normal distribution with mean near the center. A right-skewed shape (long tail to the right) means most values are low with a few very high outliers, common in income data. A left-skewed shape means most values are high with a few very low outliers. A flat shape indicates roughly uniform data. A bimodal shape with two peaks suggests two subgroups in the data.
Can I compare two frequency polygons on the same chart?+
Yes, and this is one of the main advantages of frequency polygons over histograms. By drawing two or more polygons in different colors or line styles on the same axes, you can visually compare the distributions of two groups, such as test scores before and after an intervention, or sales performance in two regions. Make sure both polygons use the same class intervals for a fair comparison.
What is the difference between a frequency polygon and an ogive?+
A frequency polygon plots frequency (count per class) against midpoints. An ogive (cumulative frequency polygon) plots cumulative frequency against the upper class boundary. The frequency polygon shows where data is most concentrated (peaks at modes). The ogive always rises from zero to N and is used to estimate percentiles by reading off the y-axis at any x value.
Why does the frequency polygon extend to zero on both ends?+
The polygon is extended to the x-axis one class width before the first midpoint and one class width after the last midpoint, giving it anchor points at frequency zero on both sides. This creates a closed, well-defined geometric shape (the polygon) rather than a floating line. The enclosed area represents the total frequency. This convention also makes it easier to compare the shapes of two polygons drawn on the same axes.

What is a frequency polygon and how is it drawn?

A frequency polygon is a line graph drawn by connecting the midpoints of the tops of histogram bars. First compute the midpoint of each class interval. Plot each midpoint on the x-axis against its frequency on the y-axis. Connect the plotted points with straight line segments. Extend the line to zero on both ends, one class width before the first and one class width after the last midpoint, to close the polygon.

How do you find the midpoint of a class interval?

The midpoint (also called the class mark) is the average of the lower and upper class boundaries: midpoint = (lower limit + upper limit) / 2. For the class 10 to 20, the midpoint is (10+20)/2 = 15. For 20 to 30 it is 25. These midpoints are the x-values plotted on the frequency polygon.

What is the formula for the mean from a frequency polygon?

Mean = sum(f_i * m_i) / sum(f_i), where m_i is the midpoint of class i and f_i is its frequency. For midpoints 10, 20, 30, 40, 50 with frequencies 5, 12, 18, 10, 5: Mean = (50+240+540+400+250)/50 = 1480/50 = 29.6.

How do you find the modal class from a frequency polygon?

The modal class is the class interval with the highest frequency. Its midpoint is the mode estimate for the grouped data. On the polygon, it corresponds to the highest peak. For frequencies 5, 12, 18, 10, 5 on midpoints 10-50, the modal class midpoint is 30.

How is standard deviation computed from grouped data?

Population SD from grouped data = sqrt[sum(f_i * (m_i - mean)^2) / N], where N is the total frequency. For midpoints 10-50 with frequencies 5,12,18,10,5: mean=29.6, variance=123.84, SD = sqrt(123.84) = 11.13.

What is the difference between a histogram and a frequency polygon?

A histogram uses bars to represent frequency for each class interval. A frequency polygon uses line segments connecting the midpoints of those bars. The frequency polygon is better for comparing two or more distributions on the same chart because the lines do not overlap as bars would.

Can a frequency polygon have two peaks?

Yes. A bimodal distribution produces a frequency polygon with two distinct peaks. This indicates two common ranges of values in the data, such as a class with both very young and very old students, or a bimodal exam score distribution. A unimodal polygon has one peak.

What is the median class in a frequency polygon?

The median class is the class whose cumulative frequency first reaches or exceeds N/2, where N is the total number of observations. For N=50, you look for the class where the running total of frequencies reaches 25. If cumulative frequencies at classes 1 through 3 are 5, 17, 35, the median class midpoint is the third class midpoint.

How do you choose the number of class intervals for a frequency polygon?

A common rule is to use between 5 and 15 classes. Sturges' formula suggests k = 1 + 3.322 * log10(n) classes for n observations. For 50 observations, k = 1 + 3.322 * log10(50) = 1 + 3.322 * 1.699 = about 7 classes. Fewer classes oversimplify the shape; more classes produce a jagged polygon.

What is a cumulative frequency polygon (ogive)?

An ogive is drawn by plotting cumulative frequencies against the upper class boundaries and connecting the points. Unlike a frequency polygon (which shows density per class), the ogive shows total count up to each point. The ogive always slopes upward from zero to N. The 50th percentile (median) is read at the point where the ogive reaches N/2.