Statistics
Standard deviation calculator for CSV data
Paste rows straight from a CSV file, an Excel or Google Sheets export, or a LIMS report. Choose which column to read, and the calculator returns the standard deviation of that column. It skips the header and any text cells and shows the working.
Rows are split on commas, semicolons or tabs, whichever your file uses. A header row is skipped and reported.
Separate numbers with commas, spaces or new lines, or paste a spreadsheet column.
Decimals and negatives are fine; write 10:3 for a value that occurs 3 times.
Your results will appear here: the standard deviation first, then the rest of the summary and a chart.
Standard deviation (sample)
0.17499
Your values typically sit about 0.175 above or below their mean of 50.05, in the same units as your data. 5 of 8 values (63%) fall between 49.87 and 50.22, within one standard deviation of the mean; for normally distributed data about 68% would.
Population SD (σ): 0.163688, if these values are the whole group.
- Count (n)
- 8
- Mean (x̄)
- 50.0475
- Variance (s²)
- 0.0306214
- Standard error
- 0.0618682
- Minimum
- 49.79
- Q1 (25%)
- 49.9225
- Median
- 50.065
- Q3 (75%)
- 50.145
- Maximum
- 50.31
- Range
- 0.52
More statistics (5)
- Relative SD (%RSD)
- 0.349647%
- Coefficient of variation
- 0.00349647
- Sum (Σx)
- 400.38
- Sum of squares, Σ(x − x̄)²
- 0.21435
- IQR (Q3 − Q1)
- 0.2225
Data distribution
Shaded bands mark ±1, ±2 and ±3 SD from the mean. 5 of 8 values (63%) fall within ±1 SD.
Chart as text
Mean 50.0475, sample standard deviation s = 0.17499, from 8 values between 49.79 and 50.31.
- Within ±1 SD (49.87 to 50.22): 5 of 8 values (63%). About 68% for normal data.
- Within ±2 SD: 8 (100%). About 95% for normal data.
- Within ±3 SD: 8 (100%). About 99.7% for normal data.
Show the working, step by step
How the calculator reads a CSV
- Delimiter. Each line is split on tabs if any line has a tab, otherwise on semicolons if any line has one, otherwise on commas. Tabs cover data copied straight out of a spreadsheet; semicolons cover European CSV.
- Column. The chosen column is read from every row, counting from 1 at the left. Rows that are too short for that column are ignored.
- Quotes. Surrounding double quotes are removed, so
"21.4"reads as 21.4. - Non-numbers. Headers,
N/A, units such as50.1 g, and anything else that is not a plain number are skipped and listed. Empty cells are ignored silently.
Choose All numbers in the box to switch this off and read every number in the box, as the main standard deviation calculator does. That suits a single pasted column or a comma-separated list.
A worked example
The default data is eight fill weights from four batches, with the weight in column 1 and a
batch label in column 2. The header weight_g is skipped, which leaves
50.12, 49.87, 50.31, 50.05, 49.94, 50.22, 50.08, 49.79.
- Sum = 400.38 over n = 8, so the mean is 50.0475 g.
- The squared deviations from the mean add up to Σ(x − x̄)² = 0.21435.
- Treating the rows as a sample, divide by n − 1 = 7: s² = 0.0306214.
- s = √0.0306214 = 0.174990 g.
If these eight fills were the entire population of interest, you would divide by n instead and get σ = 0.163688 g. The standard error of the mean is 0.174990 ÷ √8 = 0.0618682 g.
s = √( Σ(x − x̄)² ÷ (n − 1) )
Getting a CSV out of common tools
| Source | How to export | What to watch for |
|---|---|---|
| Excel | File → Save As → CSV UTF-8, or just copy the cells | Copied cells arrive tab-separated, which is fine. Formatted cells such as 1,250.00 or 12% must be plain numbers. |
| Google Sheets | File → Download → Comma-separated values | Formula errors such as #DIV/0! come out as text and are skipped. |
| European locale | Save As CSV | Semicolon delimiter, comma decimals. Both are read correctly. |
| LIMS / instrument software | Report export → CSV | Often several header lines and a units row. All are skipped, but check the count matches the number of results you expect. |
| Survey platforms | Responses → Export → CSV | Answer codes can be text ("Agree"). Export numeric values, not labels. |
The same calculation in code
For a file too big to paste, or a calculation you need to repeat:
| Tool | Sample SD (n − 1) | Population SD (n) |
|---|---|---|
| pandas | pd.read_csv('f.csv')['weight_g'].std() | ….std(ddof=0) |
| NumPy | np.std(x, ddof=1) | np.std(x) |
| R | sd(read.csv('f.csv')$weight_g, na.rm = TRUE) | sqrt(mean((x - mean(x))^2)) |
| Excel / Sheets | =STDEV.S(A2:A9) | =STDEV.P(A2:A9) |
The defaults are a trap. pandas' .std() uses ddof=1 (sample), but NumPy's
np.std() uses ddof=0 (population), so the two disagree on the same column.
R's sd() returns NA if any value is missing unless you pass
na.rm = TRUE. For semicolon files use pd.read_csv(f, sep=';', decimal=',')
or R's read.csv2(). The Python
and R guides go further.
Check the count before trusting the result
The quickest check on an import is the count. If the file has 120 results and the calculator reports n = 118, two cells were skipped. The note above the result names them, and they are often values with a unit or a stray character attached. A value that is present but wrong, such as a misplaced decimal point, will not be skipped. It shows up as a flagged z-score in the working, or as an outlier on the outlier calculator.
Related calculators
-
Large datasets
Thousands of values from an export, and what changes at that scale.
-
Standard deviation in Excel
STDEV.S, STDEV.P and the errors they throw.
-
Standard deviation in Python
NumPy, pandas and the ddof setting.
-
Descriptive statistics
The whole summary of a column in one table.
Common questions
How do I get the standard deviation of a CSV column?
Open the file in a text editor or spreadsheet and copy the rows, including the header if you like. Paste them into the box above and choose the column under Read column. The calculator splits each row on commas, semicolons or tabs, skips anything that is not a number, and tells you what it skipped.
Does the header row break the calculation?
No. A header such as weight_g is not a number, so it is skipped and listed
in a note above the result. The same applies to text cells like N/A, which
are left out rather than counted as zero.
Should I use the sample or the population standard deviation?
Use the sample SD (n − 1) when the rows are a sample of something larger: a batch drawn
from production, respondents from a population. Use the population SD (n) only when the
file holds every member of the group you care about. Excel's STDEV.S,
pandas' .std() and R's sd() all return the sample version.
My CSV uses commas as decimal points. Will it work?
Yes, if the file uses semicolons between cells, which is how European spreadsheets
export when the comma is the decimal mark. With All numbers in the box selected,
a list like 12,5; 13,1 is read as 12.5 and 13.1, and the calculator says so.
Reading a single column works too: in a semicolon- or tab-separated file, a cell such as
12,5 is read as 12.5.
Why do my results differ slightly from Excel?
Check three things. First, the function: STDEV.P gives a smaller number
than STDEV.S. Second, blanks and text: Excel ignores them in a range, as this
calculator does, but a cell holding 0 counts. Third, display rounding: the
cell may show fewer decimals than it stores.