Worked example: Standard Deviation Calculator
Existing four-number example. This fixed reference example shows one complete scenario; the interactive results above use your current inputs.
View the example inputs
- Numbers
- 1, 2, 3, 4
- Main result
- Population (N)
- Mean interval (optional)
- Off (descriptive)
| Calculated quantity | Example result |
|---|---|
| Population standard deviation (σ) | 1.1180339887 |
| Population variance (σ²) | 1.25 |
| Count | 4 |
| Sum | 10 |
| Mean | 2.5 |
| Median | 2.5 |
| Mode | No repeated values |
| Minimum | 1 |
Standard Deviation Calculator: understand spread, formulas and uncertainty
What does standard deviation tell me about my data?
Standard deviation describes how widely observations vary around their mean. A result of zero means every entered observation is identical. A larger result means more dispersion on the same measurement scale; it does not automatically mean that the observations are inaccurate, that a process is unacceptable or that an investment is unsuitable.
The Standard Deviation Calculator reports spread alongside the mean, count, variance and other descriptive statistics. For example, 9, 10, 11 and 0, 10, 20 both have mean 10, but their sample standard deviations are 1 and 10. The mean alone hides the difference. Compare datasets with consistent units and definitions before interpreting their spread.
Standard deviation is the square root of an average squared deviation, with the chosen denominator. It is not the average absolute distance from the mean. Squaring gives unusually distant observations more influence, so a few extreme values can materially change the result.
Should I use sample or population standard deviation?
Choose Population when you want to describe the complete entered set as your population of interest. Its variance divides the centered sum of squares by N. Choose Sample when the observations represent a sample and you need the usual sample variance, which divides by n−1. The square root then gives the corresponding standard deviation. Both versions remain available in the additional results.
For the same nonconstant data with at least two observations, sample SD is population SD multiplied by the square root of n/(n−1). The distinction matters more for small n. One observation has population SD zero as a description of that one-value set, but sample SD is undefined because its denominator would be zero.
The n−1 correction makes the usual sample variance unbiased under independent, identically distributed sampling with finite variance. It does not make the square root an exactly unbiased estimator of population SD for every distribution. A dropdown choice also cannot turn a biased or dependent dataset into a representative random sample.
How do I enter numbers into the Standard Deviation Calculator?
Paste individual observations separated by commas, spaces, newlines or semicolons. Use a dot for decimals and enter scientific notation such as 1e-3 when useful. A comma is a separator: 1,234 means the observations 1 and 234, not the single value 1234. Repeated observations must be included repeatedly; a value followed by a frequency is not a supported weighted-data format.
The tool accepts up to 5,000 values within a 20,000-character field limit. Remove headings, units and missing-value markers before calculating; it does not silently drop invalid cells. Nonzero magnitudes must fall between 1e-150 and 1e150. Inputs whose decimal precision cannot be distinguished by the numeric display are rejected instead of being silently merged.
Changing Main result selects the variance denominator and primary SD. Mean interval is a separate optional calculation. It defaults to Off because descriptive spread does not, by itself, justify a sampling confidence interval. Confidence controls the primary interval; its supporting table includes eight levels.
How do I calculate standard deviation step by step?
For 1, 2, 3, 4, first count the four observations and calculate their mean: 10/4 = 2.5. Subtracting 2.5 gives −1.5, −0.5, 0.5 and 1.5. Squaring those differences gives 2.25, 0.25, 0.25 and 2.25, which add to 5.
Population variance is 5/4 = 1.25, so population standard deviation is approximately 1.1180339887. Sample variance is 5/3, so sample standard deviation is approximately 1.2909944487. Keep full precision until the final display rather than feeding a rounded mean or variance back into the next step.
The calculation-steps table follows your selected convention. The detailed table keeps original input order and shows every observation, deviation and squared deviation. The frequency table instead sorts distinct values and records counts and cumulative shares. Its CSV exports all rows, including those beyond the visible page.
What are the units of variance and standard deviation?
Standard deviation has the same units as the observations. If lengths are measured in centimeters, SD is in centimeters and variance is in square centimeters. The calculator does not attach a unit you did not enter; interpret all numerical fields using your dataset’s common measurement scale.
Adding the same constant to every observation changes the mean but leaves variance and SD unchanged. Multiplying every observation by a constant multiplies SD by its absolute value and variance by its square. This makes rescaling useful for extreme numerical ranges, provided the units and transformation are retained when interpreting the result.
A large SD measured in dollars cannot be compared directly with a small SD measured in percentages. Percentage changes and percentage-point differences are also different inputs. A comparison is meaningful only after the measured quantity and units agree.
How should I read the frequency table and distribution visual?
The frequency table answers how often each exact accepted value occurs. Frequencies sum to the observation count, and unrounded relative frequencies sum to 100%. A repeated value with the highest frequency is a mode; if no value repeats, this tool reports no repeated values. None of these counts changes when you switch between sample and population SD.
The distribution visual groups the observed numerical range into equal-width bins and draws a horizontal bar for each count. Lower endpoints are included; upper endpoints are excluded except in the final bin. The bins summarize your data and do not imply a fitted bell curve or a normality test. For very large common offsets, labels show offsets from the smallest observation to keep small differences readable.
Use the observed-coverage table to see how many entered observations lie within one, two and three selected SDs of the mean. The theoretical normal proportions shown beside them are references, not required percentages for an arbitrary dataset. Identical values all lie at the mean, so their observed coverage is 100% despite the normal reference values.
What is the difference between standard deviation, standard error and margin of error?
Standard deviation describes variation among observations. Standard error describes the sampling variability of a mean under an inferential model. For the usual independent-sample calculation, estimated SE is sample SD divided by the square root of n. Margin of error multiplies that SE by a critical value for a chosen confidence level. These quantities should not share one interchangeable label.
The optional Student t method uses sample SD and n−1 degrees of freedom, regardless of the descriptive Main result selection. The optional normal z approximation uses the selected descriptive SD. Calling that second calculation an approximation matters: a population-divisor SD computed from these observations is not automatically an externally known population σ.
For a complete census of the finite population you care about, its mean is already described by the entered values; a sampling margin is unnecessary. For inference to a broader population, independence, sampling design and distributional assumptions need justification. The data entry cannot establish those conditions.
How do I interpret a 95% confidence interval for the mean?
A two-sided mean interval has lower and upper bounds equal to the mean minus and plus its margin of error. Under independent normal sampling with unknown variance, the Student t construction has its stated coverage. Approximate applications to other distributions need additional justification, especially for small samples, extreme outliers or very high confidence levels.
A 95% confidence level describes the long-run coverage of the method over repeated suitable samples. It is not a 95% probability statement about the already calculated fixed interval, and it does not mean that 95% of individual observations lie inside the bounds. It is also not an interval estimate for standard deviation itself.
The visual compares 90%, 95% and 99% mean intervals on a shared offset scale. The full table includes 68.27% and higher-confidence levels up to 99.9999%. More nines widen the modeled interval; they do not supply stronger evidence that the sampling assumptions hold. Zero observed spread collapses the arithmetic interval to a point, without proving that every source of uncertainty is absent.
Why can standard deviation calculators disagree?
First match the actual observations, selected denominator and any rounding. A comma used as a thousands separator on one system and a data separator on another produces different datasets. Sample and population formulas also give different answers without either being an arithmetic error.
Numerical precision is another cause. For 1000000000000000, 1000000000000000 and 1000000000000001, population variance is exactly 2/9 even though the mean cannot be displayed exactly as a finite decimal. Computing deviations from a rounded numeric mean can distort that small spread. This implementation accumulates accepted decimal observations as scaled integers and obtains the centered second moment before converting results to finite numeric precision.
That approach preserves small differences in the calculation; it does not create extra measurement accuracy. Displayed values and CSV numeric cells still have finite precision. Very extreme data may need rescaling. Outliers are retained rather than automatically removed; inspect their context and consider a robust spread measure separately when standard deviation does not answer the intended question.
Standard deviation, variance and uncertainty formulas
Use one consistent dataset and measurement scale. Inferential formulas require sampling assumptions; descriptive quantities do not establish them.
| Quantity | Formula | Meaning |
|---|---|---|
| Mean | Σx/N | Arithmetic center; units of observations |
| Population variance | Σ(x−μ)²/N | Descriptive spread in squared units |
| Sample variance | Σ(x−x̄)²/(n−1) | Usual sample estimate, n≥2 |
| Standard deviation | Square root of the selected variance | Spread in original units |
| Estimated SE of mean | s/√n | Sampling precision under an independent-sample model |
| Student t margin | t(1−α/2,n−1) × s/√n | Half-width of a mean interval; not observation spread |
| Mean | Σx/N | Arithmetic center; units of observations |
| Population variance | Σ(x−μ)²/N | Descriptive spread in squared units |
| Sample variance | Σ(x−x̄)²/(n−1) | Usual sample estimate, n≥2 |
| Standard deviation | Square root of the selected variance | Spread in original units |
| Estimated SE of mean | s/√n | Sampling precision under an independent-sample model |
| Student t margin | t(1−α/2,n−1) × s/√n | Half-width of a mean interval; not observation spread |
Same mean, different standard deviations: illustrative datasets
All three datasets have n=3 and mean 10. These are arithmetic examples, not benchmarks for an acceptable amount of variability.
| Observations | Mean | Sample SD | Population SD | Range |
|---|---|---|---|---|
| 10, 10, 10 | 10 | 0 | 0 | 0 |
| 9, 10, 11 | 10 | 1 | 0.816497 | 2 |
| 0, 10, 20 | 10 | 10 | 8.164966 | 20 |
| 10, 10, 10 | 10 | 0 | 0 | 0 |
| 9, 10, 11 | 10 | 1 | 0.816497 | 2 |
| 0, 10, 20 | 10 | 10 | 8.164966 | 20 |
Formula and calculation method
Mean = Σx/N. Centered sum of squares M₂ = Σ(x−mean)². Population variance = M₂/N and population SD = √(M₂/N). Sample variance = M₂/(n−1) and sample SD = √(M₂/(n−1)), with n≥2.
Accepted decimal input is accumulated with scaled integers: M₂ = [NΣI²−(ΣI)²]/N × 10^(2e), where x=I×10^e. The subtraction is exact BigInt arithmetic, not subtraction of large floating-point squares. Numeric results and CSV cells are rounded to JavaScript Number precision.
Student t interval for a population mean: mean ± t(1−α/2,n−1) × s/√n. Normal approximation: mean ± z(1−α/2) × selected SD/√n. A descriptive SD calculated from entered data is not automatically a known population parameter.
Standard deviation describes observations; standard error describes the sampling precision of a mean under a model. Margin of error = critical value × SE. None of these validates random sampling, independence or normality.
Frequency percentages = count/N × 100. Cumulative frequencies include all values up to the row. Mean±kSD coverage counts use unrounded centered deviations and inclusive endpoints; normal-reference percentages are theoretical, not guaranteed data coverage.
Scope and Limitations
- Unweighted numeric observations only; no missing-value imputation, frequency-weight input or grouped-data approximation. Each repeated observation must be entered separately.
- Confidence intervals are optional model-based calculations, not a guarantee about a dataset. Student t is exact for independent normal sampling with unknown variance; non-normal small samples, dependence or selection bias require separate consideration. Z with a selected descriptive SD is labeled an approximation.
- Numbers use finite numeric output precision, even though decimal accumulation is exact. Bounds and distinguishability guards prevent silently merged observations or zero variance caused by underflow; rescale unsupported data.
Reference Sources
- NIST: measures of scale, variance and standard deviation
- NIST: confidence limits for the mean
- NIST: normal distribution
- NIST: numerical accuracy and reference datasets
Frequently asked questions
What is the formula for population standard deviation?
Take the square root of the sum of squared deviations from the mean divided by N: σ = √[Σ(x−μ)²/N]. The result describes the entered population on the original measurement scale.
What is the formula for sample standard deviation?
For n≥2, use s = √[Σ(x−x̄)²/(n−1)]. The correction applies to the sample variance; sample SD is not universally an exactly unbiased estimator of population SD.
Can standard deviation be negative or zero?
It cannot be negative. Zero means all entered values are identical. A singleton population has SD zero, while a singleton sample has no defined sample SD.
Is variance the same as standard deviation?
No. Standard deviation is the square root of variance. Variance has squared measurement units; SD has the original observation units.
Is standard error the same as standard deviation?
No. SD summarizes observation spread. The usual estimated SE of an independent sample mean is sample SD/√n; margin of error additionally multiplies by an appropriate critical value.
Do mean plus or minus two standard deviations contain 95% of my data?
Not necessarily. About 95.45% is a theoretical normal-distribution proportion. This page separately counts actual coverage in your observations and does not assume they are normally distributed.
Why are confidence intervals optional?
Descriptive spread alone does not establish random sampling, independence or a suitable distribution model. Student t and normal approximation options expose those calculations without claiming that every dataset justifies inference.
Can I enter negative numbers, decimals or scientific notation?
Yes, within the documented magnitude and precision limits. Use a dot for decimals and delimit observations with commas, whitespace or semicolons. Missing-value labels, thousands separators and frequency weights are not inferred.
Does the CSV contain every observation?
Yes. Each table download includes all its rows at numeric calculation precision, including rows not currently displayed by pagination. The text result download and Copy link with inputs are also available; very long inputs may exceed the practical share-link limit.