Calculate standard error
Group 1
Group 2
The working for your most recent calculation appears here.
No data yet. Enter values in any of the first five tabs.
What is standard error?
Standard error (SE) measures how much a sample statistic, such as a mean or a proportion, would vary from one random sample to the next. For the mean, it is the sample standard deviation divided by the square root of the sample size: SE = s / √n. The smaller the standard error, the more closely a sample mean tends to land near the population mean.
The word "error" here means sampling error, the gap between a sample mean and the population mean that comes from looking at only part of the population. Imagine drawing thousands of samples of the same size and writing down each mean. Those means form a sampling distribution, and the standard deviation of that distribution is the standard error. In practice you have one sample, so the formula estimates the spread from the standard deviation of that single sample.
This page holds the calculator and worked examples. The standard error guide derives the formula in full, and the sampling distributions section explains where the square root of n comes from, together with the central limit theorem. SEM is the standard error of the mean specifically. Proportions, differences, and regression slopes each have their own standard errors, covered below.
Standard error formulas
Each formula divides a measure of spread by something that grows with sample size, so larger samples give smaller standard errors. The six formulas below match the modes in the calculator.
Mean (SEM)
SE = s / √n
s = sample standard deviation
n = sample size
(use σ in place of s only if
the population SD is known)
Mean, finite population
SE = (s / √n) × √((N − n) / (N − 1))
N = population size
Apply when n is more than
about 5% of N
Proportion
SE = √(p̂(1 − p̂) / n)
p̂ = x / n
x = number of successes
Difference of two means (Welch)
SE = √(s₁²/n₁ + s₂²/n₂)
df from the Welch–Satterthwaite
equation
Difference of two means (pooled)
SE = sp √(1/n₁ + 1/n₂)
sp² = ((n₁−1)s₁² + (n₂−1)s₂²)
/ (n₁ + n₂ − 2)
Difference of two proportions
SE = √(p̂₁(1−p̂₁)/n₁
+ p̂₂(1−p̂₂)/n₂)
Two details cause most wrong answers. The sample standard deviation divides by n − 1, not n, and feeding the divide-by-n version into s / √n makes the standard error too small. The mistake is easy to see below about n = 30. The second detail is that σ / √n applies only when the population standard deviation is known in advance. That is rare outside textbook problems, so s / √n is the formula you will use almost every time.
If your sample is more than about 5% of a finite population, multiply by the correction factor √((N − n) / (N − 1)). The finite population correction page shows where it comes from, and the first tab of the calculator applies it when you fill in N.
How to calculate standard error step by step
Take eight measurements: 12, 15, 11, 14, 18, 16, 13, 17. The steps below give the standard error of their mean.
n = 8, so √n = √8 = 2.8284.
The values add to 116, so the mean is 116 / 8 = 14.5.
The deviations from 14.5 are −2.5, 0.5, −3.5, −0.5, 3.5, 1.5, −1.5, and 2.5. Their squares add to 42.
The sample variance is 42 / 7 = 6, so s = √6 = 2.4495.
SE = 2.4495 / 2.8284 = 0.8660.
With 7 degrees of freedom the 95% critical value is t* = 2.3646. The margin of error is 2.3646 × 0.8660 = 2.05, and the 95% confidence interval for the mean is 12.45 to 16.55.
Mean = 14.50, SE = 0.87, n = 8. Paste the eight values into the Mean (raw data) tab to reproduce this. When you already have a summary, skip steps 1 to 4: a sample of 25 with s = 5 gives SE = 5 / √25 = 1.
How sample size changes the standard error
Because n sits under a square root, the standard error shrinks slowly. Quadrupling the sample size halves it. The table holds the standard deviation at 10 and varies n.
Standard error of the mean for s = 10
| Sample size (n) | SE = 10 / √n | 1.96 × SE | SE compared with n = 10 |
|---|---|---|---|
| 10 | 3.162 | 6.20 | 100% |
| 25 | 2.000 | 3.92 | 63.2% |
| 50 | 1.414 | 2.77 | 44.7% |
| 100 | 1.000 | 1.96 | 31.6% |
| 400 | 0.500 | 0.98 | 15.8% |
| 1,000 | 0.316 | 0.62 | 10.0% |
| 10,000 | 0.100 | 0.20 | 3.2% |
Going from n = 100 to n = 400 halves the standard error, while the same 300 extra observations added to a sample of 1,000 change very little. The 1.96 column uses the normal critical value. For samples under about 30 the calculator uses the t critical value instead, which is larger.
To plan for a target, rearrange the formula to n = (s / SE)². With s = 10 and a target SE of 0.5, you need n = 400. The sample size calculator handles the confidence-interval version of the same planning question.
Standard error vs standard deviation
Standard deviation describes how far individual observations sit from the mean. Standard error describes how far a sample mean is likely to sit from the population mean. Altman and Bland frame the contrast as description versus inference, and note that a sample's standard deviation does not systematically change as the sample grows while the standard error keeps falling.
Standard deviation compared with standard error of the mean
| Property | Standard deviation | Standard error |
|---|---|---|
| What it describes | Spread of the individual values | Precision of the sample mean as an estimate |
| Formula | s = √(Σ(x − x̄)² / (n − 1)) | SE = s / √n |
| Effect of a larger sample | Settles near the population value | Falls in proportion to 1 / √n |
| Typical use | Describing the sample | Confidence intervals and tests |
| Units | Same as the data | Same as the data |
For n of 2 or more, the standard error of the mean is always smaller than the sample standard deviation, because it is s divided by a number greater than 1. The page on standard deviation vs standard error goes further, and the standard deviation guide covers the first half of that pair.
Standard error of a proportion
A proportion has its own formula because the spread of a yes/no variable is set by p itself: SE = √(p̂(1 − p̂) / n). If 120 of 200 respondents say yes, p̂ = 0.60 and SE = √(0.60 × 0.40 / 200) = √0.0012 = 0.0346, about 3.5 percentage points. The 95% interval is 0.60 ± 1.96 × 0.0346, which runs from 53.2% to 66.8%.
The standard error is largest when p̂ = 0.5. That is why poll margins are quoted at the worst case: with n = 1,000 the SE is 0.0158 and the margin of error is about 3.1 points. The distribution of p̂ itself is covered on the sample proportions page, with more cases in the sample proportion examples.
When p̂ is near 0 or 1 and n is small, the formula gives a standard error that is too small, and at p̂ = 0 or 1 it gives exactly zero, which is not a believable uncertainty. For those cases use the Wilson score calculator, explained in the Wilson score interval guide.
Standard error of the difference between two means
To compare two independent groups you need the standard error of the difference between their means. Variances add, so this standard error is larger than either group's own: SE = √(s₁²/n₁ + s₂²/n₂).
The two variance terms are 8²/40 = 1.600 and 10²/35 = 2.857, so SE = √4.457 = 2.111. The difference in means is 5. Welch's method gives about 65 degrees of freedom and t* = 1.997, so the 95% interval is 5 ± 4.22, or 0.78 to 9.22. The interval excludes zero, which agrees with a two-sample t-test that rejects equal means at the 5% level.
The pooled version assumes both groups share one variance. Here it gives sp = 8.99, SE = 2.080, 73 degrees of freedom, and an interval of 0.85 to 9.15. The two answers are close because the groups are similar in size and spread. Welch is the safer default since it does not need the equal-variance assumption. See equal vs unequal variance, the Welch t-test, and the two-sample t-test guide.
Standard error of the difference between two proportions
A/B tests and other two-group rate comparisons use SE = √(p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂). Suppose version A converts 180 of 600 visitors and version B converts 210 of 600. Then p̂₁ = 0.30, p̂₂ = 0.35, the difference is 0.05, and SE = 0.0270. The 95% interval for the difference runs from −0.3 to 10.3 percentage points. It includes zero, so these data do not rule out equal conversion rates.
A test of the null hypothesis that the two rates are equal uses a slightly different standard error, which pools both groups under the null. Here it is 0.0270 as well, to three decimals, giving z = 1.85 and a two-sided p-value near 0.064. The calculator shows both versions. For the full test, see the two-proportion z-test for A/B tests, the A/B test calculator, and the z-test calculator.
Standard error of a regression slope
In simple linear regression the slope has a standard error too: SE(b₁) = se / √Σ(xi − x̄)², where se = √(SSE / (n − 2)) is the residual standard error. Excel calls se the standard error of the estimate (STEYX). The t statistic printed in a regression table is the slope divided by this standard error. Spread-out x values make the slope more precise, because they enlarge the denominator.
The simple linear regression calculator reports these values for your own data. The slope and intercept, residuals, and RMSE pages explain each piece.
Standard error and confidence intervals
A confidence interval is an estimate plus or minus a critical value times the standard error. For a mean with unknown σ, the critical value is t* with n − 1 degrees of freedom. For a proportion, or a mean with known σ, it is z*. In the worked example above, SE = 0.866 and t* = 2.3646 give a margin of error of 2.05. Doubling the standard error doubles the width of the interval.
The same quantity drives hypothesis tests. A t statistic is the estimate minus the hypothesized value, divided by the standard error, as in the one-sample t-test. For the next step, use the confidence interval calculator or the margin of error calculator, and read the confidence intervals guide for interpretation.
Calculate standard error in Excel, Google Sheets, Python, R, and TI-84
Every tool below computes the same number as the calculator when given the same data. The Python and R examples use the eight measurements from the worked example, so each should print 0.866.
Excel (data in A2:A9)
=STDEV.S(A2:A9)/SQRT(COUNT(A2:A9))
' Proportion, p-hat in B1 and n in B2
=SQRT(B1*(1-B1)/B2)
' Regression slope SE and standard error of the estimate (x in A, y in B)
=INDEX(LINEST(B2:B101,A2:A101,TRUE,TRUE),2,1)
=STEYX(B2:B101,A2:A101)Google Sheets
=STDEV(A2:A9)/SQRT(COUNT(A2:A9))Python
import numpy as np
from scipy import stats
x = np.array([12, 15, 11, 14, 18, 16, 13, 17])
print(stats.sem(x)) # 0.8660..., ddof=1 by default
print(x.std(ddof=1) / np.sqrt(len(x))) # same valueNumPy's std divides by n unless you pass ddof=1, which is the most common reason a hand-written version disagrees with scipy.stats.sem. The SciPy documentation lists ddof = 1 as the default for sem. More Python workflows are in statistics for Python.
R
x <- c(12, 15, 11, 14, 18, 16, 13, 17)
sd(x) / sqrt(length(x))TI-84
The calculator has no standard error command. Press STAT, choose CALC, run 1-Var Stats on your list, and read Sx and n from the output. Then compute Sx / √n on the home screen. Use Sx, the sample standard deviation, and not σx.
Should you report standard error or standard deviation?
Report the standard deviation when the goal is to describe how much the data vary. Report the standard error, or better a confidence interval, when the goal is to show how precisely a mean or other estimate was measured. Altman and Bland's BMJ note makes the same split and adds that the standard error is most useful as a step toward a confidence interval.
A mean ± SE band is also easy to misread. For large samples it is roughly a 68% confidence interval, narrower than the 95% interval most readers assume. Because the SE is always smaller than the SD, putting SE bars on a chart can make the data look tighter than they are. Journal policies differ on which one belongs in a descriptive table, so check the author guidelines. A 2018 article in the Medical Journal of Australia covers usage and reporting with examples.
Common mistakes
- Using the divide-by-n standard deviation. With the eight measurements above it gives s = 2.29 and SE = 0.81 instead of the correct 2.45 and 0.87.
- Reading the standard error as the spread of the data. Roughly 95% of individual values fall within two standard deviations of the mean, not within two standard errors.
- Applying s / √n to dependent data. The formula assumes independent observations. Repeated measures on the same person, or students clustered in classrooms, need a method that accounts for the dependence.
- Treating a standard error of zero as certainty. A proportion of 0 out of 20 gives SE = 0 from the simple formula, yet the true rate is clearly not known to be zero.
Standard error terms and formulas
This table collects the terms used on this page, with a link to the page that covers each one in depth.
Standard error glossary
| Term | Symbol or formula | Meaning | Read more |
|---|---|---|---|
| Standard error | SE | Standard deviation of a sample statistic across repeated samples | Standard error guide |
| Standard error of the mean | SEM = s / √n | Standard error of the sample mean | Sample mean distribution |
| Sample standard deviation | s | Spread of the sample, computed with n − 1 in the denominator | Standard deviation |
| Population standard deviation | σ | Spread of the whole population, rarely known | Population vs sample |
| Sampling distribution | distribution of x̄ | The values a statistic takes over repeated samples | Sampling distributions |
| Sampling variability | varies with n | Natural difference between one sample and the next | Sampling variability |
| Degrees of freedom | df = n − 1 | Independent pieces of information left after estimating the mean | Degrees of freedom |
| Critical value | z* or t* | Multiplier that turns SE into a margin of error | Critical value calculator |
| Margin of error | ME = critical value × SE | Half the width of a confidence interval | Margin of error |
| Finite population correction | √((N − n)/(N − 1)) | Factor that shrinks SE when n is a large share of N | Finite population correction |
| Relative standard error | SE / estimate | Standard error expressed as a fraction of the estimate | Coefficient of variation |
| Bootstrap standard error | SD of resampled estimates | Standard error found by resampling instead of a formula | Bootstrap sampling |
Related calculators and guides on Statistics Fundamentals
The calculator belongs to the statistics calculators hub, and the topic belongs to sampling distributions. These pages sit next to it.
Sources and further reading
- Altman DG, Bland JM. Standard deviations and standard errors. BMJ 2005;331:903. doi.org/10.1136/bmj.331.7521.903
- Macaskill P. Standard deviation and standard error: interpretation, usage and reporting. Medical Journal of Australia 2018. mja.com.au
- SciPy documentation. scipy.stats.sem. docs.scipy.org
- Wikipedia. Standard error. en.wikipedia.org
Frequently asked questions
It returns the standard error of a sample mean, a proportion, the difference between two means, or the difference between two proportions. Each result comes with a margin of error, a confidence interval, and the full working.
For a mean, divide the sample standard deviation by the square root of the sample size: SE = s / √n. A sample of 25 with s = 5 gives SE = 5 / 5 = 1. For a proportion, use SE = √(p̂(1 − p̂) / n).
Standard deviation describes how spread out the individual observations are. Standard error describes how far a sample mean is likely to be from the population mean. The standard error equals the standard deviation divided by √n, so it is always smaller for n of 2 or more.
There is no universal cutoff. A standard error is small or large only relative to the estimate and to the decision at hand. Compare it with the mean through the relative standard error (SE divided by the estimate), or look at the width of the resulting confidence interval.
Use n − 1 when s comes from a sample, which is almost always. Dividing by n gives a value that is too small on average, and the standard error inherits that bias. This calculator uses n − 1 for raw data.
The standard error falls in proportion to 1 / √n. Quadrupling the sample size halves it. To reach a target SE, rearrange the formula to n = (s / SE)².
Divide x by n to get p̂, then compute √(p̂(1 − p̂) / n). With 120 successes out of 200, p̂ = 0.60 and SE = 0.0346. Use the Proportion tab of the calculator to get the interval as well.
With data in A2:A9, enter =STDEV.S(A2:A9)/SQRT(COUNT(A2:A9)). Excel has no built-in standard error function for a mean. For a regression slope, INDEX(LINEST(y,x,TRUE,TRUE),2,1) returns its standard error.
No. The margin of error is the standard error multiplied by a critical value, such as 1.96 for a 95% interval based on the normal distribution. It is half the width of the confidence interval.
Report the standard deviation to describe variation in the data. Report the standard error, or preferably a confidence interval, to show how precisely an estimate was measured.