Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

Standard Error of the Mean (SEM): Formula, Example, Excel, R and Python

How to calculate the standard error of the mean, how it differs from SD, and why it is not 95%, with a worked example and Excel, R and Python code.

Written and maintained by CASRAI Editorial Board

Last updated

The standard error of the mean (SEM, also written SE or s.e.m.) is the standard deviation of the sampling distribution of the sample mean. In plain terms, it describes how far, on average, a sample mean will fall from the population mean (OpenStax, Introductory Statistics 2e, section 7.1). It is calculated as the sample standard deviation divided by the square root of the sample size, and it measures the precision of an estimated mean, not the spread of the individual observations.

Definition in one paragraph: what is the standard error of the mean?

If you drew many random samples of the same size from one population and computed each sample’s mean, those means would themselves vary. The standard deviation of those means is the standard error of the mean. Because it is a standard deviation of an estimate rather than of raw data, a small SEM means your sample mean is likely close to the population mean, and a large SEM means it could be far away. This is the answer to “what is statistical error” in this context: it is sampling error, the chance difference between a sample mean and the population mean, quantified.

SEM formula: how do you calculate SEM?

When the population standard deviation is known, the textbook formula is SEM = σ / √n. In practice σ is almost never known, so you substitute the sample standard deviation:

SEM = s / √n

  • SEM: the standard error of the mean, in the same units as the data.
  • s: the sample standard deviation, computed with denominator n − 1: s = √[ Σ(xᵢ − x̄)² / (n − 1) ].
  • n: the number of independent observations in the sample.
  • x̄: the sample mean.

Two consequences follow directly from the formula. First, SEM is always smaller than s when n is greater than 1. Second, SEM falls with the square root of n, so quadrupling the sample size only halves the SEM.

Worked example with the arithmetic shown

Ten measurements: 12, 15, 11, 14, 18, 13, 16, 12, 17, 14.

  1. Sum = 142, so the mean x̄ = 142 / 10 = 14.2.
  2. Deviations from the mean: −2.2, 0.8, −3.2, −0.2, 3.8, −1.2, 1.8, −2.2, 2.8, −0.2.
  3. Squared deviations: 4.84, 0.64, 10.24, 0.04, 14.44, 1.44, 3.24, 4.84, 7.84, 0.04. Their sum is 47.6.
  4. Sample variance = 47.6 / (10 − 1) = 5.2889; s = √5.2889 = 2.2998.
  5. SEM = 2.2998 / √10 = 2.2998 / 3.1623 = 0.7272.

Result: mean = 14.2, SD = 2.30, SEM = 0.73.

Interpretation: what does the SEM tell you?

The SEM is not a confidence interval and is not “95%”. To get a 95% confidence interval for the mean, multiply the SEM by the critical t value with n − 1 degrees of freedom: x̄ ± t(0.975, n−1) × SEM. In the example, t(0.975, 9) = 2.262, so the half-width is 2.262 × 0.7272 = 1.645 and the 95% CI is 14.2 ± 1.65, or 12.55 to 15.85. A mean ± 1 SEM band is narrower and has lower coverage, roughly 68% under the normal approximation. See the dictionary entry for confidence interval for the general definition.

Quantity Formula Example value What it describes
Standard deviation (SD) s 2.30 Spread of the individual observations
Standard error of the mean (SEM) s / √n 0.73 Precision of the sample mean as an estimate
95% CI half-width t × SEM 1.65 Plausible range for the population mean

How is standard error different from standard deviation?

Standard deviation describes variability among the data points in your sample and does not shrink as you collect more data (it only becomes a better estimate of the population SD). Standard error describes variability of the estimate and does shrink as n grows. Use SD to describe the sample; use a confidence interval, or a clearly labelled SEM, to show how precisely the mean is estimated. Note that “standard error” also exists for other estimates, such as a regression coefficient or a difference between two means; each has its own formula.

Why is 1 SD 68%?

It is a property of the normal distribution, not of standard deviations in general: about 68% of values lie within one SD of the mean, about 95% within two, and about 99.7% within three (the empirical or 68-95-99.7 rule). For a skewed or heavy-tailed variable the share within one SD differs. The same rule applies to sample means: by the central limit theorem, the sampling distribution of the mean is approximately normal for sufficiently large samples, so about 68% of sample means fall within one SEM of the population mean (OpenStax, section 7.1). OpenStax gives no single cutoff for “large enough”, so treat any fixed n as a rule of thumb.

Is standard error 95%?

No. The SEM is a standard deviation, not a confidence level. A 95% confidence interval is roughly 2 SEMs either side of the mean for moderate-to-large samples, and uses the t distribution for small ones, as the worked example shows (2.262 SEMs for n = 10).

Assumptions and common mistakes

  • Independent observations. The formula assumes each observation is independent. Repeated measures on the same subject, or cells from the same culture dish, are not independent; computing SEM over all of them overstates precision. Average within each independent unit first, then compute SEM across units.
  • Using n instead of n − 1. The sample SD uses denominator n − 1. R’s sd() documents this explicitly: “Like var this uses denominator n – 1.”
  • Counting missing values. If some values are missing, n in the formula must be the number of non-missing observations used in the SD.
  • Treating SEM as spread. Error bars of ± 1 SEM are shorter than SD bars and can make data look tighter than it is. Always state in the caption what the bars show.
  • Very small or non-normal samples. The normal approximation can fail for small or heavily skewed samples; use the t distribution for the interval and consider other methods for strongly skewed data.

How to report the SEM (APA style)

The APA numbers and statistics guide states that statistical symbols and abbreviations such as M, SD, t, df and p are italicized while Greek letters are not, and that numbers should be rounded as much as possible given their use and precision (APA Publication Manual, 7th edition). Following that symbol convention, the worked example would be written as:

M = 14.2, SD = 2.30, 95% CI [12.55, 15.85]

or, if you report the standard error, M = 14.2, SE = 0.73. Say in the methods or figure caption which statistic you report. For more on formatting statistics, see our guide to APA statistics reporting.

How to calculate SEM in Excel, R or Python

Each snippet uses the ten values from the worked example and returns 0.7272.

Excel

=STDEV.S(A2:A11)/SQRT(COUNT(A2:A11))

STDEV.S uses n − 1, and COUNT counts only numeric cells, so blank cells are ignored in both. For the CI half-width, multiply by T.INV.2T(0.05, COUNT(A2:A11)-1).

R

x <- c(12,15,11,14,18,13,16,12,17,14)sd(x) / sqrt(length(x))# with missing values: x <- x[!is.na(x)] first, then the same line

Python

import numpy as npfrom scipy import statsx = [12,15,11,14,18,13,16,12,17,14]np.std(x, ddof=1) / np.sqrt(len(x))   # 0.7272stats.sem(x)                          # same value; ddof=1 by default

For how NumPy’s standard deviation behaves, see numpy.std.

Planning ahead: SEM, sample size and significance

Because SEM = s / √n, you can estimate the n needed for a target precision once you have an estimate of s. For a fuller treatment, see what is a good sample size for a quantitative study. For how precision relates to significance testing, see the dictionary entries on p-value and effect size.

FAQ

What does SE mean in statistics?

SE stands for standard error. In a paper reporting means it usually means the standard error of the mean, SEM = s / √n; check the methods to confirm.

Should I report SD or SEM?

Report SD to describe the variability of your data and a confidence interval (or a clearly labelled SEM) to convey the precision of an estimate.

What is the SEM formula when the population SD is known?

SEM = σ / √n. OpenStax works an example with σ = 15 and n = 25, giving 15 / √25 = 3.

Sources

  • OpenStax, Introductory Statistics 2e, 7.1 The Central Limit Theorem for Sample Means (Averages): openstax.org/books/introductory-statistics-2e/pages/7-1-the-central-limit-theorem-for-sample-means-averages (read 2026-11-07).
  • R Core Team, R documentation for sd (package stats): stat.ethz.ch/R-manual/R-devel/library/stats/html/sd.html (read 2026-11-07).
  • American Psychological Association, Numbers and statistics guide: apastyle.apa.org/instructional-aids/numbers-statistics-guide.pdf (read 2026-11-07).

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Standard Error of the Mean (SEM): Formula, Example, Excel, R and Python

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →