How to calculate standard deviation step by step

Calculate standard deviation
Calculate standard deviation

Standard deviation tells you how spread out the values in a dataset are from the average. A small standard deviation means the values are clustered tightly together. A large one means they are scattered widely.


It is one of the most used statistics in school, research, finance, and science, and once you understand the five steps, it is straightforward to calculate by hand or with a tool.

What is standard deviation?

Standard deviation measures how much individual values in a dataset differ from the mean (average).

  • Low standard deviation: values sit close to the mean. The data is consistent.

  • High standard deviation: values are spread far from the mean. The data is variable.


Example: Two classes both average 70 on a test. Class A has scores of 68, 70, 71, 69, 72. Class B has scores of 40, 55, 70, 85, 100. Class A has a low standard deviation. Class B has a high one. Same average, completely different spread.

The two types: Population vs sample

Before calculating, you need to know which formula applies.

Type

When to use

Divide by

Population (σ)

You have data for every single member of the group

N

Sample (s)

You have data for a subset of a larger group

N minus 1


In practice: if you are a student doing statistics homework or working with a dataset that represents a portion of a larger group, use the sample formula (divide by N minus 1). This is the most common case.

How to calculate standard deviation: Step by step

We will use this dataset: 4, 8, 6, 5, 7


This could be anything. Test scores, temperatures, daily sales figures.

Step 1: Find the Mean

Add all values together, then divide by how many there are.

  • Sum: 4 + 8 + 6 + 5 + 7 = 30

  • Count: 5 values

  • Mean: 30 / 5 = 6

Step 2: Subtract the Mean from each value

This gives you the deviation of each data point, showing how far it sits from the average.

Value

Value minus Mean

Deviation

4

4 minus 6

-2

8

8 minus 6

+2

6

6 minus 6

0

5

5 minus 6

-1

7

7 minus 6

+1


Notice: the deviations always add up to zero. That is why you cannot just average them directly.

Step 3: Square each deviation

Squaring removes the negative signs and gives more weight to values far from the mean.

Deviation

Squared

-2

4

+2

4

0

0

-1

1

+1

1


Sum of squared deviations = 4 + 4 + 0 + 1 + 1 = 10

Step 4: Divide to get the variance

This is where population and sample calculations differ.


Population variance: divide by N (total count)

  • Variance = 10 / 5 = 2


Sample variance: divide by N minus 1

  • Variance = 10 / 4 = 2.5


The variance is the average of the squared deviations. It is a useful number, but it is expressed in squared units, which makes it harder to interpret directly.

Step 5: Take the square root

Taking the square root of the variance brings the result back to the original units of your data. That result is the standard deviation.


Population standard deviation: √2 = 1.41


Sample standard deviation: √2.5 = 1.58


So for the dataset 4, 8, 6, 5, 7, the values typically sit about 1.41 to 1.58 units away from the mean of 6. That is a small spread, which makes sense given how close the values are to each other.

The full formula

Population standard deviation:

σ = √( Σ(x - μ)² / N )


Sample standard deviation:

s = √( Σ(x - x̄)² / (N - 1) )


Where:

  • σ (sigma) = population standard deviation

  • s = sample standard deviation

  • x = each individual value

  • μ (mu) = population mean

  • x̄ = sample mean

  • N = total number of values

  • Σ = sum of

Worked example 2: Test scores

Dataset: 85, 90, 78, 92, 80 (sample of 5 students)


Step 1: Mean (85 + 90 + 78 + 92 + 80) / 5 = 425 / 5 = 85


Step 2: Deviations from the mean

  • 85 minus 85 = 0

  • 90 minus 85 = 5

  • 78 minus 85 = -7

  • 92 minus 85 = 7

  • 80 minus 85 = -5


Step 3: Squared deviations

  • 0² = 0

  • 5² = 25

  • (-7)² = 49

  • 7² = 49

  • (-5)² = 25


Step 4: Sum and divide (sample, so N minus 1 = 4) Sum = 0 + 25 + 49 + 49 + 25 = 148 Variance = 148 / 4 = 37


Step 5: Square root Standard deviation = √37 = 6.08


This means each student's score typically sits about 6 points away from the class average of 85.

What standard deviation tells you

Once you have the number, here is how to interpret it.


The 68-95-99.7 Rule (applies to normally distributed data):

  • 68% of values fall within 1 standard deviation of the mean

  • 95% of values fall within 2 standard deviations

  • 99.7% of values fall within 3 standard deviations


Example: If a class average is 75 with a standard deviation of 10:

  • 68% of students scored between 65 and 85

  • 95% scored between 55 and 95

  • Nearly everyone scored between 45 and 105

Standard deviation vs Variance: What is the difference?

Both measure spread, but they are expressed in different units.

  • Variance is in squared units (e.g. cm², points²). Useful in formulas and statistical models.

  • Standard deviation is in the same units as your original data (e.g. cm, points). Easier to interpret and compare directly to the mean.


For everyday interpretation, standard deviation is almost always more useful. Variance is more commonly used inside calculations like ANOVA or regression analysis.


Understanding the difference between these two measures connects directly to how to calculate average, since both start from the mean and build outward.

Common mistakes to avoid

  • Forgetting to square the deviations. If you just add the raw deviations, they cancel out to zero every time.

  • Using N instead of N minus 1 for a sample. This underestimates the true spread of the larger population.

  • Confusing variance with standard deviation. Variance is the result before the square root. Standard deviation is after.

  • Mixing up population and sample data. When in doubt, use the sample formula (N minus 1). It is the safer, more conservative estimate.

  • Treating standard deviation as a percentage. It is not a percentage. It is in the same units as your data.

How to calculate standard deviation on a calculator

Working through the steps by hand is useful for understanding the concept. For larger datasets, a calculator is the practical choice.


The scientific calculator in Calculator Air handles statistical calculations including standard deviation directly. For datasets where you want to see each step shown clearly, the AI math solver processes the full calculation and explains what is happening at each stage, which is useful when you need to show your working or understand where a result came from.


If you are solving statistics problems as part of a broader homework set, the same approach that works for standard deviation applies across related topics. Knowing how to find the mean accurately is essential, since every standard deviation calculation builds directly from it.

Frequently asked questions

  1. What is standard deviation in simple terms?

    Standard deviation is a number that tells you how spread out the values in a dataset are. A low standard deviation means values are close to the average. A high standard deviation means they are scattered far from it.


  2. How do you calculate standard deviation step by step?

    Find the mean, subtract the mean from each value, square each result, find the average of the squared values (dividing by N for a population or N minus 1 for a sample), then take the square root. The result is the standard deviation.


  3. What is the difference between population and sample standard deviation?

    Population standard deviation uses all values in a group and divides by N. Sample standard deviation uses a subset of a group and divides by N minus 1. Use the sample formula when your data represents part of a larger group.


  4. Why do we square the deviations?

    To remove negative signs. If you added raw deviations, they would always sum to zero because positives and negatives cancel out. Squaring makes every deviation positive and gives more weight to values far from the mean.


  5. What does a high standard deviation mean?

    It means the values in your dataset are spread far from the average. In test scores, it means students performed very differently from each other. In finance, it means returns are volatile and unpredictable.


  6. Can standard deviation be negative?

    No. Because you square the deviations before averaging them, the variance is always positive or zero. The square root of a positive number is always positive, so standard deviation is always zero or greater.


  7. How is standard deviation related to variance?

    Variance is the average of the squared deviations from the mean. Standard deviation is the square root of the variance. Standard deviation is in the same units as the original data, which makes it easier to interpret.

Ready to try Air Apps?