Bootstrap Confidence Interval Calculator
Paste your data, pick a statistic — mean, median, standard deviation or correlation — and get percentile and BCa bootstrap confidence intervals, the bootstrap standard error and bias, and a histogram of the resampled statistic. The random seed is recorded, so every result repeats exactly, and the method follows Efron and Tibshirani and R’s boot.ci. Free, no sign-up; your data stay in your browser.
0 values detected
Same data, settings and seed always give the same intervals.
Enter your data, then press “Run bootstrap”.
How to Use the Bootstrap Confidence Interval Calculator
- 1. Choose the statistic and paste the data. For a mean, median or standard deviation, enter one list of numbers. For a correlation, enter paired x and y values. Samples of up to 2,000 values are supported.
- 2. Set the confidence level and the number of resamples. 95% and 5,000 resamples are good defaults; use 10,000 or more when you want the interval ends to be steady to the second decimal.
- 3. Note the seed. The seed starts the random-number generator. The same data, settings and seed always give identical intervals, so write the seed in your methods section. Press “New random seed” for a fresh set of resamples.
- 4. Press “Run bootstrap”. Read the percentile and BCa intervals, the bootstrap standard error and bias, and check the histogram of resampled statistics.
What the Bootstrap Does
The bootstrap treats your sample as a stand-in for the population. It draws a new sample of the same size with replacement from your data, computes the statistic, and repeats this thousands of times. The spread of those resampled statistics shows how much the statistic would vary from sample to sample. It needs no formula for the standard error, so it works for medians, correlations and other statistics where textbook intervals are awkward or unavailable. It is not magic: it cannot repair a biased or very small sample, and it fails for statistics that depend on the extremes, such as the maximum.
Percentile, BCa, Basic and Normal Intervals
| Interval | How it is built | Strengths | Weaknesses |
|---|---|---|---|
| Percentile | The middle 95% of the resampled statistics (the 2.5th and 97.5th percentiles) | Simple; stays inside the possible range; transformation-respecting | Biased when the statistic is biased or skewed |
| BCa | Percentile, but with adjusted percentiles that correct for bias (z₀) and skewness (acceleration a) | Second-order accurate; the recommended default (Efron & Tibshirani, 1993) | Needs a reasonably large sample and enough resamples |
| Basic | 2 × estimate − the opposite percentiles | Reflects how the bootstrap distribution misses the estimate | Can leave the possible range, e.g. a correlation above 1 |
| Normal | Estimate − bias ± z × bootstrap SE | Easy to read | Assumes a bell-shaped bootstrap distribution |
BCa uses two numbers. The bias correction z₀ = Φ⁻¹(share of resamples below the estimate) is 0 when the resampled statistics are centred on the estimate. The acceleration a measures how fast the standard error changes with the parameter; it is estimated from the jackknife — the statistic recomputed with each value left out in turn. The percentiles actually read are Φ(z₀ + (z₀ + z) ÷ (1 − a(z₀ + z))) instead of 2.5% and 97.5%, interpolated between order statistics on the normal scale exactly as R’s boot package does.
A Worked Example
Click “Try an example” to load 12 values: 2.1, 2.4, 2.6, 2.7, 2.9, 3, 3.2, 3.5, 3.9, 4.6, 5.8 and 8.2, a right-skewed sample, with the mean as the statistic, 95% confidence, 5,000 resamples and seed 12345. The mean is 3.7417. The bootstrap standard error is 0.4812 and the bias −0.0054.
- Percentile interval: 2.9333 to 4.7998.
- BCa interval: 3.05 to 5.125, with z₀ = 0.0818 and a = 0.0755. The skew in the data shifts the BCa interval upward and stretches its upper end relative to the percentile interval.
- For comparison, the classic t-interval is 2.635 to 4.848, which is symmetric around the mean and ignores the skew.
Because the generator is seeded, these numbers repeat on every run. R’s boot.ci with 200,000 resamples gives a percentile interval of 2.917 to 4.792 and a BCa interval of 3.033 to 5.1 for the same data — the same method, different random draws, so they agree to within Monte Carlo error. With the median as the statistic the same settings give a median of 3.1, a percentile interval of 2.65 to 4.25 and a BCa interval of 2.6 to 4.05; in this case the jackknife acceleration is zero, because deleting one value from an even-sized sample can only move the median to one of two values. For the correlation example the estimate is r = 0.9063, the percentile interval is 0.7371 to 0.9706, and the BCa interval is 0.6703 to 0.9632; the basic interval's upper end exceeds 1, which is why the percentile or BCa interval is preferred.
Choosing the Number of Resamples
Efron and Tibshirani suggest 50–200 resamples for a standard error but at least 1,000 for a confidence interval, because the interval ends come from the tails of the resampled distribution, where there are few values. The Monte Carlo error of an end shrinks with the square root of the number of resamples, so 20,000 resamples cut it to about half of what 5,000 gives. The resampling error is separate from the error due to a small sample, which more resamples cannot fix.
Frequently Asked Questions
- What is a bootstrap confidence interval?
- It is an interval for a statistic built by resampling your own data with replacement, recomputing the statistic each time, and reading the interval from the distribution of the results. For a 95% percentile interval you take the 2.5th and 97.5th percentiles of the resampled statistics.
- Should I use the percentile or the BCa interval?
- BCa is the better default because it corrects for bias and skew in the resampled distribution and is more accurate in theory and practice. Use the percentile interval when you want the simplest explanation, when the sample is very small, or when BCa cannot be computed because every resample lies on one side of the estimate.
- How many bootstrap resamples do I need?
- At least 1,000 for a confidence interval, and 5,000 to 10,000 for a stable BCa interval. More resamples reduce the random jitter in the interval ends but do not make a small sample any more informative.
- What is the random seed for?
- Bootstrapping uses random numbers, so two runs normally give slightly different intervals. A seed fixes the sequence, making the run exactly repeatable. Report the seed, the number of resamples and the method so others can reproduce your intervals.
- Will this match R, SPSS or Stata exactly?
- The methods match: percentile and BCa intervals follow R’s boot.ci, and the same resamples give identical intervals. Each program uses its own random-number generator, though, so intervals agree within Monte Carlo error, not to the last digit. With a few thousand resamples the difference is typically in the second decimal place.
- When should I not use the bootstrap?
- With very small samples (under about 10–15 values), where the sample may not represent the population; for statistics driven by the extremes, such as the minimum or maximum; with dependent data such as time series, unless you use a block bootstrap; and when the sample is biased, because resampling reproduces the bias.