Statistics Calculator

Compute mean, median, mode, variance, standard deviation and quartiles from any dataset — plus fit a least-squares regression line to x–y pairs.

Descriptive statistics

Separate values with commas, spaces or new lines.

Linear regression

One x, y pair per line.

How it works

Mean is the arithmetic average; median the middle value of the sorted data; mode the most frequent value (reported only if some value repeats). Variance comes in two flavors: the population variance divides by n, while the sample variance divides by n − 1 (Bessel's correction), which makes it an unbiased estimate of the true variance when your data is a sample. Standard deviation is the square root of variance. Q1 / Q3 are the 25th and 75th percentiles, computed by linear interpolation between closest ranks; IQR = Q3 − Q1 measures the spread of the middle half.

Linear regression finds the line y = mx + b that minimizes the sum of squared vertical residuals (ordinary least squares). R² is the fraction of the y-variance explained by the line: 1 is a perfect fit, 0 means the line explains nothing beyond the mean.

Frequently asked questions

Should I use sample or population variance?

Use sample variance (n − 1) when your data is a sample drawn from a larger population — the usual case in experiments and surveys. Use population variance (n) only when your data is the entire population, e.g. the grades of every student in a class.

Why does it say there is no mode?

The mode is only meaningful when at least one value repeats. If every value appears exactly once, there is no most-frequent value, so the calculator reports none rather than inventing one.

What does R² tell me about the fit?

R² ranges from 0 to 1 (for a line with intercept). An R² of 0.95 means 95% of the variation in y is captured by the linear trend. A low R² does not mean the math is wrong — it means a straight line is a poor model for your data.

How are Q1 and Q3 computed?

By linear interpolation: the p-th percentile sits at position (n − 1)·p in the sorted data, blending the two nearest values. This is the same "linear" method used by NumPy and most statistics packages, so results should match them exactly.