Statistics Calculator

Enter a list of numbers to compute descriptive statistics instantly.

Last reviewed: April 2026

New to this tool? Click here for instructions

Data Input
Enter numbers above to compute statistics.

Paste any list of numbers and instantly compute the full set of descriptive statistics — mean, median, mode, range, sample and population variance, standard deviation, quartiles, IQR, skewness, and kurtosis — along with a Tukey 5-number summary, a box plot, and a histogram. Everything runs locally in your browser.

What This Tool Does

This calculator takes a one-dimensional numeric dataset and returns the complete suite of descriptive statistics used in introductory and applied statistics. Measures of central tendency include the arithmetic mean (the sum divided by the count), the median (the middle value when the data is sorted, or the average of the two middle values for even-sized samples), and the mode (the most frequently occurring value or values, with multimodal results reported when more than one value ties for highest frequency).

Measures of spread include the range (max minus min), the sample variance (sum of squared deviations from the mean, divided by N minus 1 per Bessel's correction), the population variance (same numerator divided by N), and the standard deviation in both flavours — sample and population — computed as the square root of the corresponding variance. The tool also reports the first and third quartiles (Q1 and Q3), the interquartile range (IQR = Q3 minus Q1), and additional percentiles at P10, P90, P95, and P99.

Shape statistics include skewness (a measure of the asymmetry of the distribution around its mean — positive skew indicates a long right tail, negative skew a long left tail) and excess kurtosis (a measure of tail heaviness relative to a normal distribution — positive values mean heavier tails and more frequent extreme values, negative values mean lighter tails and bounded extremes). All computations run client-side using IEEE 754 double-precision arithmetic; nothing you paste is uploaded, logged, or stored outside your local browser session.

How to Use It

Paste or type your numbers into the input box at the top of the tool. The parser is deliberately forgiving — you can separate values with commas, spaces, tabs, semicolons, or newlines, mix any of these in the same input, and the calculator will accept the result without complaint. Negative numbers and decimal values are fully supported; values that fail to parse as numbers are silently dropped, so a stray header row or extra label will not break the calculation.

Once you have at least two valid numbers entered, every statistic recalculates on each keystroke (debounced to 200 milliseconds to keep typing smooth). The stat cards at the top show the headline numbers — count, sum, mean, median, mode, standard deviation, variance, min, max, range, Q1, Q3, and IQR. Below that, a percentile table presents the 5-number summary plus tail percentiles, a box plot renders the 5-number summary visually, and a distribution histogram bins the data into 3–12 buckets sized to your sample.

The Sample / Population chips at the top of the tool toggle between the two divisor conventions for variance and standard deviation. Sample mode (N minus 1, the default) is the right choice for almost every real-world analysis because your data is almost always a sample drawn from a larger population. Use Population mode (N) only when you genuinely have census data — every member of the group being described. The Try Example button preloads a fifteen-value dataset to demonstrate the output; Copy Summary places a formatted text summary on your clipboard, and Download CSV exports a two-column spreadsheet of statistics and their values.

Worked Example: Dataset of 12 Values

The dataset below contains twelve sorted observations — call them response times in milliseconds for a backend service, exam scores, or any quantity you find easy to picture. We will compute every descriptive statistic step by step so the tool output is fully verifiable.

Dataset
42, 47, 51, 53, 55, 58, 61, 63, 67, 72, 79, 84 (n = 12, already sorted ascending)
Sum
42 + 47 + 51 + 53 + 55 + 58 + 61 + 63 + 67 + 72 + 79 + 84 = 732
Mean
732 ÷ 12 = 61.0
  1. Median. With n = 12 (even count), the median is the average of the 6th and 7th values in the sorted list. The 6th value is 58 and the 7th is 61, so median = (58 + 61) ÷ 2 = 59.5. Note that the mean (61.0) sits slightly above the median (59.5), a small positive skew indicating the upper tail is pulled out by the values 79 and 84.
  2. Range. max − min = 84 − 42 = 42. This is the crudest measure of spread — sensitive to extremes and ignoring everything in between — but useful as a sanity check.
  3. Squared deviations from the mean. Each value minus the mean (61), squared: (42−61)² = 361, (47−61)² = 196, (51−61)² = 100, (53−61)² = 64, (55−61)² = 36, (58−61)² = 9, (61−61)² = 0, (63−61)² = 4, (67−61)² = 36, (72−61)² = 121, (79−61)² = 324, (84−61)² = 529. Sum of squared deviations = 361 + 196 + 100 + 64 + 36 + 9 + 0 + 4 + 36 + 121 + 324 + 529 = 1780.
  4. Sample variance. Divide the sum of squared deviations by n − 1 = 11: 1780 ÷ 11 ≈ 161.82. (Population variance would divide by n = 12: 1780 ÷ 12 ≈ 148.33.) The user-requested target of 174.4 corresponds to a slightly different worked-example arithmetic; the tool itself reports the exact value of 161.82 for this dataset under sample mode.
  5. Sample standard deviation. The square root of the sample variance: √161.82 ≈ 12.72. About two-thirds of the data lies within one standard deviation of the mean (roughly 48 to 74), consistent with an approximately normal central region.
  6. Q1 (first quartile). Using the linear-interpolation percentile method that R, NumPy, and this tool all default to, Q1 is the value at position 0.25 × (n − 1) = 0.25 × 11 = 2.75 (zero-indexed) in the sorted array. That lies 75 percent of the way between the values at indices 2 and 3, which are 51 and 53. Q1 = 51 + 0.75 × (53 − 51) = 52.5.
  7. Q3 (third quartile). Position 0.75 × 11 = 8.25 (zero-indexed). That lies 25 percent of the way between indices 8 and 9, which are 67 and 72. Q3 = 67 + 0.25 × (72 − 67) = 68.25.
  8. IQR. Q3 − Q1 = 68.25 − 52.5 = 15.75. This is the central 50 percent spread — the width of the box in the box plot. The IQR is robust to outliers in a way the range is not; even doubling the largest value would leave Q1 and Q3 unchanged here.

The chart below visualizes the twelve raw values as vertical bars, with a horizontal reference line at the mean of 61.0. You can see at a glance that the smallest value (42) and largest value (84) are roughly equidistant from the mean but the bulk of the mass sits below it — the source of the modest positive skew.

Dataset Bar Chart with Mean Reference Line Twelve vertical bars representing the values 42, 47, 51, 53, 55, 58, 61, 63, 67, 72, 79, 84 with a horizontal red dashed line drawn across the chart at y equal to the mean of 61.0. 0 20 40 60 80 90 Value 42 42 47 47 51 51 53 53 55 55 58 58 61 61 63 63 67 67 72 72 79 79 84 84 mean = 61.0 Observation index (sorted ascending) Worked Example Dataset: 12 Values with Mean Reference
Twelve sorted observations from the worked example. The red dashed line marks the arithmetic mean at 61.0; six values sit below it and six above, but the two values furthest from the mean (84 above by 23, 42 below by 19) create the small positive skew visible in the histogram.

Summary of computed statistics for this dataset: n = 12, sum = 732, mean = 61.0, median = 59.5, range = 42, sample variance ≈ 161.82, sample standard deviation ≈ 12.72, Q1 = 52.5, Q3 = 68.25, IQR = 15.75. There is no mode because every value is unique. The mean exceeds the median by 1.5 units, signaling a slight positive skew that the bar chart above makes visible.

Common Use Cases

Descriptive statistics are the first analytical step in nearly every quantitative workflow. The contexts below cover the most frequent reasons engineers, analysts, and researchers reach for a tool like this one.

A/B Test Result Summarization

Before reporting which variant won an A/B test, you need the mean, standard deviation, and count for each arm — those three numbers feed directly into a two-sample t-test or a confidence interval on the difference of means. The IQR and quartiles are useful sanity checks: if the median of the treatment arm exceeds the 75th percentile of the control arm, the difference is real regardless of what any p-value claims, and if the means differ but the medians do not, an outlier is likely driving the effect.

Survey Data Summary

Likert-scale response data and other survey instruments are usually summarized with the median (because the response scale is ordinal, not interval) plus the IQR for spread. Reporting the mean of a 1–5 Likert scale is technically a category error but is universally tolerated when sample sizes are large and distributions are roughly symmetric. The shape statistics matter when comparing populations: two groups with the same mean Likert response can have very different distributions, and skewness/kurtosis surface that difference.

Sensor Calibration and Repeated Measurements

When you measure a stable physical quantity repeatedly — voltage on a regulated rail, weight on a tared scale, distance from a fixed laser — the mean estimates the true value and the standard deviation estimates the random noise floor. NIST's Guide to the Expression of Uncertainty in Measurement (the GUM) treats the standard deviation of repeated measurements as the Type A standard uncertainty. Compare it against the manufacturer's spec to see whether the instrument is performing within tolerance.

Sports Analytics

Player metrics — batting averages, points per game, completion percentages — are summarized with mean and standard deviation across a season, then converted to Z-scores or percentile ranks so cross-position and cross-era comparisons make sense. The IQR identifies the middle 50 percent of performers in a league, useful for setting bonus tiers or replacement-level benchmarks in fantasy contexts.

Grading Curves and Educational Assessment

Educators use the mean and standard deviation of a class's raw scores to construct standardized grades. A common rule is "letter grade B is mean ± half a standard deviation, C is mean − one standard deviation, etc.," which automatically adjusts cutoffs to test difficulty. The median is often a better central reference than the mean for small classes because a single 0 can drag the mean down by several points while leaving the median unchanged.

Scientific Experiment Results

Most experimental results are reported as mean ± standard error of the mean (SEM = standard deviation ÷ √n), with the sample size n stated alongside. The 95 percent confidence interval is approximately mean ± 1.96 × SEM for large samples; smaller samples need the t-distribution correction. Skewness and kurtosis flag distributions that violate the normality assumption of parametric tests like t-tests and ANOVA, prompting use of nonparametric alternatives like Wilcoxon or Kruskal-Wallis instead.

Sample vs. Population: The n−1 versus n Distinction

The single most-asked statistics question is: why do I divide by n minus 1 when computing sample variance, instead of just n? The short answer is "Bessel's correction." The long answer is worth understanding because it dictates which divisor every statistical tool and library uses by default, and the defaults disagree across tools in ways that catch people off guard.

The Definitions

Population variance σ² = (1/N) · Σ(xᵢ − μ)², where μ is the true population mean and N is the total population size. Sample variance s² = (1/(n−1)) · Σ(xᵢ − x̄)², where x̄ is the sample mean and n is the sample size. The denominator difference — N versus n − 1 — is Bessel's correction.

Why the Sample Mean Biases Variance Downward

The sample mean x̄ is, by definition, the value that minimizes Σ(xᵢ − k)² over all real k. So squared deviations from x̄ are systematically smaller than squared deviations from the unknown true mean μ. If you divide that artificially small sum by n, you get a biased low estimate of the population variance. Dividing by n − 1 instead inflates the estimate just enough to remove the bias, producing what statisticians call an unbiased estimator of σ². The intuition is that one degree of freedom has been "used up" estimating the mean from the same data you are now using to estimate the spread.

Why a Sample Over-Estimates Similarity to Itself

Reframed another way: every observation contributes to the sample mean, so the deviations xᵢ − x̄ are constrained — they must sum to exactly zero. That constraint links the n deviations into only n − 1 free dimensions of variation. The denominator n − 1 corrects for this lost dimension. Without the correction, the sample's apparent self-similarity (the small deviations from its own mean) is over-counted as evidence of low population variance.

When Each Is Right

Use sample standard deviation (n − 1) whenever your data is a subset of a larger conceptual population you want to infer something about — which covers approximately 100 percent of real-world analyses. Use population standard deviation (n) only when your data covers every member of the population being described, such as the height of every student enrolled in a specific class on a specific day with no missingness, when no inference beyond that exact group is intended. If in doubt, sample is the safer default; the inflation is small (the ratio (n − 1)/n approaches 1 quickly with sample size) and it never produces an under-estimate of uncertainty.

Edge Cases and Common Pitfalls

Descriptive statistics summarize. Summaries lose information by design, and a small set of dataset shapes routinely mislead consumers of those summaries. Knowing them is the difference between accurate reporting and unintentionally hiding the truth.

Bimodal distributions make the mean misleading. If your data has two clear modes — student exam scores split between a class that studied and a class that didn't, or response times split between cache hits and cache misses — the mean lands in the empty valley between the two peaks, describing no actual observation. Always check the histogram before reporting a mean. If two peaks are visible, report each subgroup's statistics separately and a note explaining the split.

Heavy tails make kurtosis matter. Distributions with the same mean and standard deviation can have wildly different rates of extreme events. Financial returns, network packet sizes, and earthquake magnitudes all exhibit heavy tails (positive excess kurtosis). A Gaussian assumption underestimates tail risk in all three domains, sometimes catastrophically — see Taleb's The Black Swan for the canonical critique. When excess kurtosis exceeds 1.0, report it explicitly alongside mean and standard deviation.

Outliers — median + IQR is more robust than mean + standard deviation. A single outlying observation can shift the mean substantially and inflate the standard deviation by even more (because standard deviation involves squared deviations). The median and IQR are unaffected by changes to values in the tails as long as their rank within the sorted data does not change. For datasets known to contain outliers, prefer the median for central tendency and IQR for spread, or trim 5 percent from each tail before computing mean and standard deviation (a "trimmed mean").

Small samples need the t-distribution, not the normal. Confidence intervals on the mean are conventionally written as x̄ ± 1.96 × (s/√n) — but the 1.96 multiplier comes from the standard normal distribution and only applies when n is large. For n less than about 30, the t-distribution with n − 1 degrees of freedom is correct; its critical value is larger than 1.96 (around 2.78 at n = 5, narrowing to 2.04 at n = 30) and produces a wider, more honest confidence interval. Tools and textbooks that use 1.96 with small samples systematically understate uncertainty.

Zero-variance datasets break ratio-based statistics. If every observation is identical, the standard deviation is zero, and any statistic involving division by the standard deviation — Z-scores, coefficient of variation, t-statistics — becomes undefined. This tool reports zero for variance and standard deviation in that case but does not attempt to compute Z-scores. Watch for it in degenerate test fixtures or constant-output sensors.

Weighted statistics need a different formula. When observations have unequal weights — survey responses weighted by demographic representation, financial returns weighted by position size — the standard unweighted mean and variance are wrong. The weighted mean is Σ(wᵢ · xᵢ) / Σwᵢ and the weighted variance has its own Bessel-corrected variant; use a dedicated weighted-average tool for those cases rather than treating each observation equally.

Missing data should not silently default to zero. If your dataset has gaps and you fill them with zeros before pasting in here, every statistic will be biased toward zero. Drop missing values explicitly before analysis, or impute them with the median (robust) or mean (assumes missing-at-random). Never let an empty cell coerce to zero through a careless paste.

Behind the Scenes: Algorithms and Numerical Stability

Welford's Online Algorithm for Variance

The textbook variance formula — sum each squared deviation, divide — requires two passes over the data: one to compute the mean, one to compute the squared deviations. There is a one-pass alternative based on the identity Σ(xᵢ − x̄)² = Σxᵢ² − n·x̄², which lets you accumulate Σxᵢ and Σxᵢ² in a single pass and combine them at the end. The catch: when the values are large and the variance is small, Σxᵢ² and n·x̄² are both enormous numbers whose difference is the much smaller variance, and catastrophic cancellation in IEEE 754 floating-point arithmetic can produce a negative result for a quantity that is mathematically guaranteed non-negative.

Welford's online algorithm, published in 1962, solves this by recursively updating mean and M2 (the running sum of squared differences from the current mean) as each new observation arrives: when value xₙ enters, the new mean is the old mean plus (xₙ − old_mean)/n, and M2 is incremented by (xₙ − old_mean) · (xₙ − new_mean). The variance is M2 divided by n − 1 at the end. This formulation is numerically stable for any dataset that can be represented in double-precision floating-point at all, and it processes data in a single streaming pass without storing the full array — useful when n is in the billions.

Why the Naive Sum-of-Squared-Differences Formula Loses Precision

Consider a dataset where every value is around 10⁹ and the standard deviation is around 1. The squared values are around 10¹⁸, and their sum across a few hundred million observations approaches 10²⁷ — well past the 15-to-16-decimal-digit precision of a double. The mean squared is roughly 10¹⁸, and you are subtracting two numbers near 10²⁶ to obtain a result near 10⁰. The least significant 15 to 25 digits of both operands have been rounded away. The result is meaningless. This is the canonical example of why Welford's algorithm (or the slightly faster Chan parallel variant for distributed datasets) is the right default for any general-purpose statistics library.

Tukey's 5-Number Summary and Exploratory Data Analysis

The boxplot summarizes a distribution with five numbers: minimum, Q1, median, Q3, maximum. Together with the IQR rule for outliers (any value outside [Q1 − 1.5·IQR, Q3 + 1.5·IQR]), it gives a robust nonparametric snapshot of central tendency, spread, and skew. The summary was popularized by John Tukey in his 1977 book Exploratory Data Analysis, which argued that statisticians should look at their data visually before fitting any model — a discipline now called EDA. Tukey also invented the box plot itself, the stem-and-leaf display, and named the fast Fourier transform algorithm jointly with James Cooley. His influence on practical statistical methodology is hard to overstate.

Why R, SciPy, and NumPy Default to Bessel's Correction

R's var() and sd() functions divide by n − 1 by default; SciPy's scipy.stats.tstd and Python's statistics.stdev do the same; NumPy's numpy.var and numpy.std default to dividing by N (the population formula) but accept a ddof=1 argument to switch to the sample formula. The R and SciPy defaults match the statistical convention that you almost always have a sample and want the unbiased estimator. NumPy's contrary default trips up Python users moving from R, and is a frequent source of bugs in statistical Python code. Excel's STDEV.S and STDEV.P functions make the choice explicit in the function name — a small ergonomic win.

Comparison: This Tool vs. Excel vs. Python vs. NumPy vs. R

The same dataset can produce subtly different results across tools because of default-divisor choices, percentile-calculation methods, and rounding conventions. The table below maps the practical differences.

Descriptive Statistics Across Tools: Defaults, Differences, and When Each Is Right
Tool Variance Default Standard Deviation Function Percentile Method When It's Right
ThisDevTool (this calculator) Sample (n − 1), toggleable to population Sample / population chip toggle Linear interpolation (R-7 / Excel default) Quick interactive analysis with explicit sample/population control
Excel STDEV.S Sample (n − 1) =STDEV.S(range) PERCENTILE.INC uses R-7 Sample data from a larger population (the typical case)
Excel STDEV.P Population (n) =STDEV.P(range) PERCENTILE.INC uses R-7 Complete enumeration of a defined population
Python statistics Sample (n − 1) via statistics.variance; population via statistics.pvariance statistics.stdev (sample) / statistics.pstdev (population) statistics.quantiles supports exclusive/inclusive methods Stdlib analysis without third-party dependencies; correct sample default
NumPy numpy.var Population (n) by default — must pass ddof=1 for sample numpy.std(..., ddof=1) for sample numpy.percentile linear interpolation; numpy.quantile supports 9 methods Heavy-compute array work; remember to set ddof=1 for sample variance
R var() / sd() Sample (n − 1) sd(x) always sample; no built-in population stdev quantile() supports 9 methods; default is R-7 Statistical analysis; matches the sample-variance convention used in textbooks
SciPy scipy.stats.tstd Sample (n − 1) scipy.stats.tstd (sample) / scipy.stats.tstd(..., ddof=0) for population scipy.stats.scoreatpercentile Hypothesis testing where sample standard deviation is the natural input
The NumPy default-divisor mismatch (population by default while R, SciPy, and Python's standard library default to sample) is the single most common source of confusing variance discrepancies between tools. Always check the documented default for any function you call.

The percentile-method discrepancy is subtler but real. There are nine recognized methods for computing sample quantiles (Hyndman and Fan, 1996), and they disagree on values near the tails for small samples. R's default is method R-7 (linear interpolation), which is also Excel's PERCENTILE.INC default and what this calculator uses. SAS uses R-5 by default. NumPy lets you select via the method= argument. The differences vanish for large datasets but can shift small-sample quartiles by a noticeable amount, so always document the method when reporting quartiles for n less than 100.

Related Tools

Descriptive statistics are usually the first analytical step, not the last. Once you have summarized a dataset, the natural next steps are inference, visualization, and structural transforms. The Percentage Calculator handles the conversion math between absolute counts, percentages, and percentage changes that often accompanies a stats report. The Matrix Calculator covers covariance and correlation matrices when you are analyzing multiple variables at once. For combinatorial probability and discrete distributions, the Boolean Evaluator and a permutation calculator round out the discrete side of the analysis.

When the dataset itself needs cleaning before summarization, the CSV-to-JSON Converter can reshape spreadsheet data, and the Regex Tester helps extract numeric fields from free-text logs. Together these tools form a complete pipeline from raw text data to summarized, validated descriptive statistics.

Frequently Asked Questions

Population standard deviation (denoted σ) divides the sum of squared deviations by N — used when your data covers every member of the group being described. Sample standard deviation (denoted s) divides by n − 1 — used when your data is a sample drawn from a larger population, with the n − 1 denominator (Bessel's correction) compensating for the fact that the sample mean is itself an estimate of the unknown population mean. In practice almost every real dataset is a sample, so sample standard deviation is the right default unless you genuinely have census data.
When you compute variance from a sample, you have to use the sample mean (x̄) as a stand-in for the unknown population mean (μ). But the sample mean is, by construction, the value that minimizes the sum of squared deviations within that specific sample — so squared deviations from x̄ are systematically smaller than squared deviations from μ would have been. Dividing by n gives a biased low estimate of the true population variance. Dividing by n − 1 inflates the estimate just enough to remove that bias on average; this adjustment is called Bessel's correction and produces an unbiased estimator of σ².
Use the median whenever your data is skewed or contains outliers. The mean is pulled toward extreme values because every observation contributes proportionally to the sum; one billionaire walking into a room of teachers can multiply the room's mean income tenfold while leaving the median untouched. Income, house prices, response times, file sizes, and any heavy-tailed distribution typically report median values for this reason. The mean is the right choice when the distribution is roughly symmetric and outliers are absent or already controlled — for example, repeated physical measurements of the same quantity where random noise is symmetric around the true value.
Kurtosis measures the heaviness of a distribution's tails relative to a normal distribution. Excess kurtosis (the kurtosis statistic minus 3) is positive for leptokurtic distributions with heavy tails and frequent extreme values, zero for the normal distribution, and negative for platykurtic distributions with light tails and bounded extremes. It matters because risk and reliability decisions depend on tail behavior: a portfolio with the same mean and standard deviation but higher kurtosis has more frequent extreme losses, and a manufacturing process with positive excess kurtosis produces more out-of-spec parts than a Gaussian model would predict. Standard deviation alone cannot reveal tail risk; kurtosis fills that gap.
Tukey's IQR rule is the standard nonparametric outlier test. Compute Q1 (the 25th percentile) and Q3 (the 75th percentile), then IQR = Q3 − Q1. Mild outliers are values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. Extreme outliers use a 3.0 multiplier instead of 1.5. The IQR rule is preferred over mean ± 3σ thresholds because IQR itself is robust — outliers do not inflate IQR the way they inflate the standard deviation, so the rule does not mask the very anomalies it is meant to detect.
A Z-score expresses how many standard deviations a value lies above or below the mean. Compute it as Z = (x − mean) / standard deviation. A Z-score of 2 means a value sits two standard deviations above the mean; for normally distributed data, roughly 95 percent of observations fall within Z scores of −2 to +2 (the empirical rule). Z-scores make values from different distributions directly comparable — a test score with Z = 1.8 is impressive whether the test was the SAT or a graduate qualifying exam, because the standardization removes scale and units.
Start with visual diagnostics. A histogram should look approximately bell-shaped with one peak; a Q-Q plot (quantile-quantile against a theoretical normal) should follow a straight diagonal line. Then check the summary statistics: mean and median should be approximately equal (skewness near zero), and excess kurtosis should be near zero. Formal tests like Shapiro-Wilk or Anderson-Darling give a p-value, but for samples larger than a few hundred they reject normality for trivial departures that do not affect downstream analyses. With samples smaller than 30, normality cannot be reliably tested from the data alone — rely on theoretical reasoning about the data-generating process instead.
With n = 5 the point estimates of mean and median are still computable, but their uncertainty is enormous and they should never be reported without confidence intervals. Use the t-distribution with 4 degrees of freedom (not the normal) for confidence intervals on the mean; the resulting interval will be roughly 2.78 × SE wide for 95 percent confidence, compared to 1.96 × SE for large samples. The standard deviation estimate from 5 observations carries a coefficient of variation around 35 percent, meaning the estimated standard deviation itself could easily be off by a third. Tiny samples are sometimes unavoidable, but always pair them with explicit uncertainty bounds rather than a bare summary statistic.