Skip to content

Bootstrap Confidence Interval Calculator

Bootstrap a confidence interval for the mean, median, standard deviation or a proportion from your data: percentile and BCa intervals, standard error and histogram.

Calculator Details

Bootstrap confidence interval:43.1429 to 136.843See results ↓

Your sample, separated by commas, spaces or new lines (2 to 500 values); for a proportion, use 1 for yes and 0 for no

What to estimate from the sample

For example 90, 95 or 99

Percentile: the middle share of the bootstrap values. BCa: adjusted for bias and skewness (more accurate, Efron & Tibshirani ch. 14). Both are shown in the table

How many bootstrap samples to draw (1,000 to 10,000 is typical for an interval)

Fixes the random draws so the same inputs always give the same interval; change it to see the Monte Carlo variation

Your Results

Bootstrap confidence interval: 43.1429 to 136.843

Bootstrap confidence interval

43.1429 to 136.843

95% percentile interval for the mean, 2,000 resamples of n = 7

Sample mean

86.8571

The statistic of your data

Bootstrap standard error

24.023

Standard deviation of the resampled statistics

Bias estimate

0.511214

Mean of the resamples minus the sample statistic

The sample mean is 86.8571; the 95% bootstrap percentile confidence interval from 2,000 resamples is 43.1429 to 136.843, with a standard error of 24.023.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Bootstrap distribution of the mean

Bootstrap distribution of the mean

Detailed Breakdown

Both interval methods
MethodLowerUpper
Percentile (shown above)43.1429136.843
BCa44.3318138.469

BCa: bias correction z₀ = −0.01003, acceleration a = 0.02912.

Bootstrap distribution (histogram bins)
RangeResamplesShare
21 to 27.136930.1%
27.1369 to 33.273880.4%
33.2738 to 39.4107211.1%
39.4107 to 45.5476 (in the interval)341.7%
45.5476 to 51.6845 (in the interval)572.9%
51.6845 to 57.8214 (in the interval)914.5%
57.8214 to 63.9583 (in the interval)1286.4%
63.9583 to 70.0952 (in the interval)1618.1%
70.0952 to 76.2321 (in the interval)1648.2%
76.2321 to 82.369 (in the interval)1979.8%
82.369 to 88.506 (in the interval)20910.4%
88.506 to 94.6429 (in the interval)1668.3%
94.6429 to 100.78 (in the interval)1879.3%
100.78 to 106.917 (in the interval)1678.3%
106.917 to 113.054 (in the interval)1075.3%
113.054 to 119.19 (in the interval)1035.1%
119.19 to 125.327 (in the interval)753.8%
125.327 to 131.464 (in the interval)512.5%
131.464 to 137.601 (in the interval)291.5%
137.601 to 143.738140.7%
143.738 to 149.875160.8%
149.875 to 156.01270.4%
156.012 to 162.14910.1%
162.149 to 168.28640.2%

How This Calculator Works

How it's calculated

The bootstrap treats your sample as a stand-in for the population. It draws B new samples of the same size n from your values, with replacement (some values appear twice, some not at all), and works out the statistic for each. The spread of those B values estimates how much the statistic varies from sample to sample: their standard deviation is the bootstrap standard error.

The percentile interval takes the 2.5th and 97.5th percentiles of the bootstrap values. The BCa interval moves those percentiles using a bias correction z₀ (from the share of bootstrap values below the sample statistic) and an acceleration a (from leaving out one value at a time, the jackknife). Percentiles are read from the sorted values at position (B + 1) × p, interpolating between neighbours as R's boot package does.

Resample 1: 99, 94, 94, 99, 16, 38, 141 → 83
Resample 2: 141, 16, 16, 99, 38, 141, 197 → 92.5714
Resample 3: 38, 197, 99, 197, 23, 94, 197 → 120.714
… 2,000 resamples in all (seed 12345)
SE = 24.023; positions 50.03 and 1950.97 of the sorted values → 43.1429 to 136.843

Frequently Asked Questions

What is a bootstrap confidence interval?

An interval for a statistic built by resampling your own data. The calculator draws many samples of the same size from your values, with replacement, works out the statistic for each, and uses the spread of those results in place of a formula. For the default data (the treatment group of Efron and Tibshirani's mouse survival example) the mean is 86.86 days and the 95% percentile interval runs from 43.14 to 136.8.

When should I use the bootstrap instead of a t interval?

When there is no simple formula for the standard error, as for a median or a ratio, or when the data are skewed and the sample is too small to trust the normal approximation. For the median of the default data the bootstrap gives a standard error of 37.88; textbook formulas for the median's standard error assume large samples. For a mean of roughly normal data the t interval and the bootstrap usually agree.

What is the difference between the percentile and BCa intervals?

The percentile interval takes the middle 95% of the bootstrap values. The BCa (bias-corrected and accelerated) interval shifts those cut-offs to allow for bias in the statistic and for a standard error that changes with the parameter. It is more accurate in theory and usually the better choice for skewed statistics. Here the percentile interval is 43.14 to 136.8 and the BCa interval 44.33 to 138.5.

Why is there a random seed?

Resampling is random, so two runs give slightly different intervals. The seed fixes the random draws, so the same inputs and seed always give the same answer and a shared link shows exactly what you saw. Changing the seed from 12345 to 2 moves the lower end from 43.14 to 42.14: that difference is Monte Carlo error, and more resamples make it smaller.

How many resamples do I need?

Efron and Tibshirani suggest about 200 for a standard error and at least 1,000 for a confidence interval, since the ends of the interval depend on the tails of the bootstrap distribution. 2,000 is a good default; use 5,000 to 10,000 when you want the endpoints stable to more digits.

How do I bootstrap a proportion?

Choose "Proportion" and enter your data as 1s (yes, success) and 0s (no). The statistic is the share of 1s. For a simple proportion the point-estimate calculator gives the standard Wilson and Wald intervals; the bootstrap is useful as a check, or when the proportion comes from a more complicated sampling process.

What does the standard error mean here?

It is the standard deviation of the bootstrap values: how much the statistic would vary from sample to sample. For the mean it approaches the familiar s/√n (times √((n − 1)/n)); for the default data the bootstrap gives 24.02. The bias is the average bootstrap value minus the sample statistic.

Can the bootstrap fix a small or biased sample?

No. It only reuses the values you have, so it can’t add information about values you didn’t observe. With very small samples bootstrap intervals tend to be too narrow, and a sample that doesn’t represent the population gives a confidently wrong interval.

Nonparametric bootstrap with a seeded random generator (mulberry32): the same data, settings and seed always give the same interval, and a different seed shows how much the result moves from one set of resamples to another. Percentile and BCa intervals follow Efron & Tibshirani (1993); endpoints are read from the sorted resamples as R's boot package does. Both intervals are shown whichever you choose. Not included: the basic, normal, studentized (bootstrap-t) and ABC intervals, two-sample or paired comparisons, regression coefficients, the parametric, block (time-series) and smoothed bootstraps, and weighted data. A bootstrap interval is only as good as the sample: with very few values (under about 10 to 15) it tends to be too narrow.

Bootstrap Confidence Interval Calculator: Percentile and BCa Intervals

By FindMySum · Last reviewed

A bootstrap calculator finds a confidence interval for a statistic by resampling your data rather than by using a formula. You paste a sample, choose the statistic (the mean, the median, the standard deviation or a proportion), and the calculator draws thousands of new samples from yours, computes the statistic for each and reads the interval off their spread. It gives the percentile interval and the more refined BCa interval, the bootstrap standard error and a histogram of the resampled values.

The resampling is driven by a seeded random number generator, so the same inputs always give the same interval and a shared link reproduces your result exactly.

The idea behind the bootstrap

A confidence interval needs to know how much a statistic would change if you could repeat the study many times. Classical methods get that from a formula: the standard error of a mean is s/√n. For many statistics, such as the median, a trimmed mean, a correlation or a ratio, there is no simple formula, or the formula relies on assumptions (normality, large samples) that your data may not meet.

The bootstrap's answer is to let the sample stand in for the population. If your sample is representative, drawing from it with replacement behaves like drawing new samples from the population. Repeat that B times, compute the statistic each time, and the B results form the bootstrap distribution: an estimate of the statistic's sampling distribution.

Step by step

  1. Compute the statistic θ̂ on your n values.
  2. Draw a resample: n values chosen at random from your data, with replacement.
  3. Compute the statistic on the resample. Repeat steps 2 and 3 B times.
  4. The standard deviation of the B results is the bootstrap standard error. Their mean minus θ̂ estimates the bias.
  5. Read the interval from the sorted results.

Percentile and BCa intervals

The percentile interval is the simplest: for 95% confidence, take the 2.5th and 97.5th percentiles of the bootstrap distribution. It works well when the bootstrap distribution is roughly symmetric and centred on θ̂.

The BCa interval (bias-corrected and accelerated, Efron 1987) adjusts which percentiles are used. The bias correction z₀ comes from the share of bootstrap values below θ̂: if more than half fall below, the statistic is biased upward and the interval shifts. The acceleration a, worked out with the jackknife, corrects for a standard error that changes with the true parameter, which shows up as skewness. The adjusted percentiles are Φ(z₀ + (z₀ + z_α)/(1 − a(z₀ + z_α))), where z_α is the normal quantile. When z₀ and a are both 0, BCa reduces to the percentile interval.

Both are shown, because both are in common use. BCa is generally more accurate, especially for skewed statistics such as the standard deviation, but it needs more resamples to be stable and is undefined when every resample lands on the same side of θ̂, as with constant data.

The calculator reads percentiles the way R's boot package does: the value at position (B + 1) × p of the sorted results, interpolating between neighbours on the normal-quantile scale. Other software may use a slightly different percentile rule and give endpoints that differ in the last digits.

Worked example: mouse survival times

The calculator opens with the treatment group of a small experiment from Efron and Tibshirani's book: survival times of 7 mice, 94, 197, 16, 38, 99, 141 and 23 days. Their mean is 86.86 days.

  1. Resample: with seed 12345 the first resample has a mean of 83.0 days, the next 92.6, the next 120.7.
  2. Repeat: 2,000 resamples give a bootstrap standard error of about 24.0 days. The formula s/√n gives 25.2, and the bootstrap's theoretical limit for a mean, s/√n × √((n − 1)/n), is 23.4.
  3. Interval: the 95% percentile interval runs from about 43.1 to 136.8 days; the BCa interval from about 44.3 to 138.5.

With only 7 values the interval is wide, as it should be, and the two methods differ slightly because the data are skewed by the 197.

How many resamples?

Efron and Tibshirani suggest 50 to 200 resamples for a standard error and at least 1,000 for an interval, because percentiles in the tails need many values to settle. The default here is 2,000. To see how much your endpoints depend on chance, change the seed: if the interval moves in a digit you care about, increase B.

When the bootstrap struggles

  • Very small samples. With fewer than about 10 to 15 values the bootstrap distribution has too few distinct values and intervals tend to be too narrow.
  • Extremes. The bootstrap can't estimate the maximum or minimum of a population, because a resample can never exceed the largest value in your sample.
  • Dependent data. Time series and clustered data need block or cluster bootstraps; resampling single values breaks the dependence.
  • Unrepresentative samples. Resampling reuses the information you have. It can't correct for a biased sample.

For a single proportion or mean of a large sample, the classical intervals on the point estimate and z-score pages are simpler and nearly identical. The bootstrap earns its keep with medians, standard deviations and other statistics without an easy formula.

More questions

Who invented the bootstrap?

Bradley Efron of Stanford University introduced it in 1979 in the Annals of Statistics paper 'Bootstrap Methods: Another Look at the Jackknife'. The name comes from the phrase 'to pull oneself up by one's bootstraps': the method estimates the variability of a statistic from the sample alone, without a formula or extra data.

Why resample with replacement?

Sampling n values from n without replacement would just reorder the data and give the same statistic every time. With replacement each resample is a different mix, some values repeated and some left out, which mimics drawing a fresh sample from a population that looks like your data.

Is a 95% bootstrap interval guaranteed to contain the true value 95% of the time?

Only approximately. The coverage approaches 95% as the sample grows. For small samples percentile intervals often cover less than the nominal level; BCa intervals were designed to correct much of that error, and Efron and Tibshirani show they are second-order accurate. Heavy tails and very small samples still cause undercoverage.

What is the jackknife, used in the BCa interval?

The jackknife recomputes the statistic n times, each time leaving out one value. How much those leave-one-out values vary, and how lopsided they are, measures how the statistic responds to the data. The BCa acceleration constant a is a scaled measure of that lopsidedness (skewness).

Can I bootstrap a difference between two groups?

Yes, by resampling each group separately and recomputing the difference each time, but this calculator handles one sample at a time. You can run it on each group to see their separate intervals; for the difference itself, a two-sample t test or a statistics package is the right tool.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy