Statistical Calculator: Mean, Standard Deviation, T-Test and Regression
Paste numbers or upload a CSV to get descriptive statistics, a histogram, a one-sample t-test, linear regression and sample size. Free and private.
Descriptive statistics
Results
Enter data and press Calculate to see results.
Histogram
A histogram appears here after you calculate.
One-sample t-test
Tests whether the mean of the data above differs from a hypothesised population mean μ₀ (two-tailed).
Enter data in the box above and a hypothesised mean.
Linear regression (least squares)
Enter paired X and Y values in the same order. Both lists need the same count, at least 2 points.
Results appear here.
A scatter plot with the fitted line appears here.
Sample size for estimating a mean
n = (z × σ ÷ E)², rounded up. Confidence can be typed as 95 or 0.95.
Enter values to calculate the required sample size.
How to use the statistical calculator
- Paste or type your numbers in Your data, separated by commas, spaces or new lines. You can also upload a .csv or .txt file; any text such as column headers is skipped and counted.
- Press Calculate statistics to get the mean, median, mode, quartiles, range, both standard deviations and a histogram.
- For a t-test, keep the data in the main box, enter the hypothesised mean μ₀ and α, then press Run t-test.
- For regression, enter matching X and Y lists and press Run regression to get the line of best fit, r and R².
- Use Export results to download the descriptive statistics as a CSV file.
Formulas used
Mean x̄ = Σx ÷ n
Population SD σ = √( Σ(x − x̄)² ÷ n ) Sample SD s = √( Σ(x − x̄)² ÷ (n − 1) )
t = (x̄ − μ₀) ÷ (s ÷ √n), degrees of freedom = n − 1
Slope b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)², intercept a = ȳ − b·x̄
Worked example
Eight UPSC aspirants record daily study hours of 5.1, 4.9, 5.6, 5.8, 6.0, 5.7, 5.3 and 5.5. Is their average different from 5 hours?
| Statistic | Value |
|---|---|
| Mean x̄ | 5.4875 hours |
| Sample SD s | 0.3682 |
| Standard error s ÷ √n | 0.1302 |
| t (df = 7) | 3.745 |
| Two-tailed p-value | 0.0072 |
Because p = 0.0072 is below α = 0.05, the average differs significantly from 5 hours. The 95% confidence interval for the mean is about 5.18 to 5.80 hours.
Tips and common mistakes
- Pick the right SD. Exam questions on a whole group (such as “the marks of all 10 students”) usually want the population SD; research and survey data usually need the sample SD.
- Check outliers with the IQR. Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are commonly flagged as outliers.
- Correlation is not causation. A high R² shows a strong straight-line pattern, not that X causes Y.
- Small samples: the t-test assumes the data come from a roughly normal population; with very few points, treat the result with care.
- For the Indian Statistical Service, UGC NET or CSAT data-interpretation practice, use the tool to check hand calculations rather than replace them.
Key facts
- Variance is the square of the standard deviation.
- For a symmetric distribution the mean and median are equal; a long right tail pulls the mean above the median.
- The correlation coefficient r ranges from −1 to +1, and in simple linear regression R² = r².
Frequently asked questions
What is the difference between sample and population standard deviation?
Population standard deviation divides the sum of squared deviations by n, while sample standard deviation divides by n − 1. Use the sample version when your numbers are a sample from a larger group, which is the usual case in research and surveys; for 2, 4, 4, 4, 5, 5, 7, 9 the population SD is 2 and the sample SD is about 2.138.
How do I calculate the mean, median and mode?
The mean is the sum of the values divided by how many there are; the median is the middle value after sorting; the mode is the value that occurs most often. For 3, 5, 5, 8, 9 the mean is 6, the median is 5 and the mode is 5.
What does the p-value in a one-sample t-test mean?
The p-value is the probability of getting a sample mean at least this far from the hypothesised mean if the null hypothesis were true. If p is smaller than your significance level α (often 0.05), you reject the null hypothesis; the calculator reports an exact two-tailed p-value from the t distribution.
How is the regression line calculated?
The calculator uses ordinary least squares: slope b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)², and intercept a = ȳ − b·x̄. R² shows the share of the variation in y explained by the line, from 0 to 1.
How are quartiles calculated here?
Q1 is the median of the lower half of the sorted data and Q3 is the median of the upper half, leaving out the overall median when the count is odd. Spreadsheets such as Excel use interpolation methods, so their quartiles can differ slightly for small datasets.
Is my data uploaded anywhere?
No. All calculations, including reading CSV or text files, happen in your browser, and nothing is sent to a server.