Confidence interval calculator

Calculate confidence interval calculator with clear inputs and assumptions.

Calculate confidence interval calculator with clear inputs and assumptions.

Both dots and commas are accepted as decimal separators.

Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.

Method and assumptions

Method version 1.0.0 · Updated

Calculate

Formula: Calculate confidence interval calculator with clear inputs and assumptions.

Calculate confidence interval calculator with clear inputs and assumptions.

mean
Mean
sd
Standard deviation (> 0)
count
Sample size (> 0)

Results are estimates where noted and depend on the entered assumptions.

Calculate with code

These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.

JavaScript
const mean = 50, sd = 10, n = 100, z = 1.96;
const margin = z * sd / Math.sqrt(n);
console.log([mean-margin, mean+margin]); // 95% normal interval: [48.04, 51.96]
TypeScript
const mean=50, sd=10, n=100, z=1.96;
const margin: number = z*sd/Math.sqrt(n);
console.log([mean-margin, mean+margin]);
Python
import math
mean, sd, n, z = 50, 10, 100, 1.96
margin = z*sd/math.sqrt(n)
print(mean-margin, mean+margin)  # 95% normal interval
Java
double margin=1.96*10/Math.sqrt(100);
System.out.println((50-margin) + " to " + (50+margin)); // 95% interval
C#
double margin=1.96*10/Math.Sqrt(100);
Console.WriteLine($"{50-margin} to {50+margin}"); // 95% interval