Math · free · step by step

Statistics Calculator

Paste or type numbers to get the mean, median, mode, standard deviation, variance, quartiles and outliers, with a histogram, a box plot and the working. Switch to x, y pairs for the line of best fit and correlation.

Results

All results

Step by step

Charts

Frequency table

ValueCountPercentCumulative

Worked example

Mean, median, mode and standard deviation of 2, 4, 4, 4, 5, 5, 7, 9

MeasureWorkingAnswer
Mean(2 + 4 + 4 + 4 + 5 + 5 + 7 + 9) ÷ 8 = 40 ÷ 85
Median8 values, so average the 4th and 5th: (4 + 5) ÷ 24.5
Mode4 appears 3 times4
Range9 − 27
Population standard deviation (σ)√(32 ÷ 8)2
Sample standard deviation (s)√(32 ÷ 7)2.138089935
QuartilesMedians of 2, 4, 4, 4 and 5, 5, 7, 9Q1 = 4, Q3 = 6

Formulas

Mean, variance and standard deviation formulas

x‾=∑xns=∑(x−x‾)2n−1σ=∑(x−μ)2N

The sample standard deviation s divides by n − 1 (Bessel’s correction) because a sample’s own mean sits closer to its values than the true mean does; dividing by n would underestimate the spread. The population formula σ divides by N and is right only when the data is the whole population. Variance is the standard deviation squared.

More math

Other math tools

Questions

Statistics Calculator FAQ

Free, private and works offline: everything is worked out in your browser.

How do you find the mean, median and mode?

Mean: add the numbers and divide by how many there are. Median: sort them and take the middle one (or the average of the two middle ones). Mode: the value that appears most often. For 2, 4, 4, 4, 5, 5, 7, 9: mean = 5, median = 4.5, mode = 4.

How do you calculate standard deviation?

Subtract the mean from each number, square the results, add them up, divide by n − 1 for a sample (or by n for a whole population), then take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 the sample standard deviation is 2.138089935 and the population standard deviation is 2.

Should I use sample or population standard deviation?

Use the sample formula (divide by n − 1) when your numbers are a sample from a bigger group, which is the usual case in surveys and experiments. Use the population formula (divide by n) only when you have every member of the group. The calculator shows both and lets you pick which one leads.

How are quartiles calculated?

There is more than one method. By default the calculator uses the one on TI-84 and Casio calculators and in most textbooks: Q1 and Q3 are the medians of the lower and upper halves, leaving out the middle value when the count is odd. For 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 that gives Q1 = 15 and Q3 = 43. Excel’s QUARTILE.INC interpolates instead and gives 25.5 and 42.5; choose “Inclusive (Excel)” to match it.

How do you find outliers?

A common rule marks values more than 1.5 × IQR below Q1 or above Q3 as outliers, where IQR = Q3 − Q1. They show as dots beyond the whiskers on the box plot and are listed in the results.

How do I find the line of best fit and correlation?

Switch to x, y pairs and enter one pair per line. The calculator fits the least-squares line y = a + bx, with slope b = Sxy ÷ Sxx and intercept a = ȳ − b·x̄, and gives the correlation r and r². For the example pairs the line is y = 2.02x − 0.02 with r = 0.9991049325.

Can I paste data from Excel or Google Sheets?

Yes. Copy a column (or two columns for x, y pairs) and paste it into the box. Numbers can be separated by spaces, commas, semicolons, tabs or new lines; up to 100,000 values work.

Is the statistics calculator free and private?

Yes. Everything is worked out in your browser, nothing you enter is uploaded, and there is no sign-up. The link updates as you type so you can share a data set.

Built and maintained by Zubaer Ahammed · Updated · Runs on your device; nothing you add is uploaded