Home / Tools / Bootstrap CI Calculator

Bootstrap Confidence Interval Calculator

Bootstrapping resamples your data thousands of times to build a confidence interval for any statistic, even ones with no closed-form formula (medians, ratios, custom functions). Paste your numbers, pick a statistic, and get normal, percentile, basic, and BCa intervals side by side. Every interval matches R's boot package, and nothing leaves your browser.

I want to bootstrap the using the method at .

New to bootstrapping? Read the 4-min primer

What the bootstrap does. Resample your data with replacement many times, recompute the statistic on each resample, and use the spread of those values as a stand-in for the sampling distribution. The bootstrap turns "I have one sample" into "here is what the statistic would have looked like across many samples", without assuming a parametric form.

Three ways to get the CI from the resamples. The percentile CI sorts the bootstrap distribution and takes the α/2 and 1−α/2 quantiles. The basic CI (reverse percentile) reflects the distribution about the original estimate. The BCa method adjusts for bias and skewness using a jackknife-derived acceleration; it is the best-practice default for moderately skewed statistics.

Bias and SE. Bias is the mean of the bootstrap distribution minus the original statistic; if it is large relative to the SE the parametric CI is suspect. The bootstrap SE is the sd of the bootstrap distribution and is a drop-in replacement for the analytic standard error.

When the bootstrap struggles. Very small n (under 10), heavy-tailed data where the variance is infinite, or statistics that depend on a single extreme order value (like the maximum). For those cases, increase B, use BCa rather than percentile, and treat the CI as approximate.

Try a real example:
📊 Scenario

Small samples, skewed distributions, or non-standard statistics where the parametric CI is unreliable or undefined.

e.g. a CI for the median of a heavy-tailed cost variable, or the IQR of response times.

  • x raw data, one value per line
  • θ statistic to bootstrap
  • B resamples, method, level, and a seed
CI method
Confidence level
no result

Enter data to see the interval

n
-
θ̂
-
bias
-
SE
-
B
-
All four intervals
methodlowerupperwidth

InferenceEnter data above to see a plain-English conclusion.

How this is computed
1
2
3
4
The same bootstrap in R

  

No data leaves your browser Verified against R's boot::boot.ci() Free, no sign-up

The bootstrap math, end to end

One resampling loop, four ways to read the interval. Here is what happens between the numbers you paste and the bounds above.

x* = sample(x, n, replace=TRUE) theta* = stat(x*) (repeat B times)
Resampling. Draw n observations from the original sample with replacement, compute the statistic on the resample, store it. After B repetitions you have the bootstrap distribution. This tool reproduces R's Mersenne-Twister and its resampling exactly, so the same seed draws the identical resamples that set.seed(seed); boot() would, and every interval matches boot.ci().
CI_norm = (theta-hat - bias) +/- z(1-alpha/2) * SE*
Normal. Treat the bootstrap distribution as approximately Gaussian: recenter the estimate by subtracting the bias, then go out z standard errors, where SE* is the SD of the bootstrap replicates. Fast and tight when the distribution is symmetric, but wrong when it is skewed.
CI_perc = ( theta*(alpha/2), theta*(1-alpha/2) )
Percentile. Sort the bootstrap distribution; read off the α/2 and 1−α/2 quantiles (with boot's normal-scale interpolation between order statistics). Simple, but ignores any bias in the bootstrap distribution.
CI_basic = ( 2*theta-hat - theta*(1-alpha/2), 2*theta-hat - theta*(alpha/2) )
Basic (reverse percentile). Reflects the percentile bounds about the original estimate. Equivalent to assuming the bootstrap distribution of theta* − theta-hat mirrors the sampling distribution of theta-hat − theta.
z0 = Phi^-1( #{theta* < theta-hat} / B ) a = sum(L^3) / [ 6 * (sum(L^2))^(3/2) ] alpha_adj = Phi( z0 + (z0 + z_alpha) / (1 - a*(z0 + z_alpha)) )
BCa (Efron 1987). z0 is the bias correction; it shifts the percentiles to account for the bootstrap mean differing from the point estimate. The acceleration a is the third-versus-second moment of the empirical influence values L. To match boot.ci() this tool uses boot's default: the regression estimate of influence when B ≥ n, and the leave-one-out jackknife when B < n. BCa is second-order accurate and almost always preferable to percentile when the distribution is skewed.
bias = mean(theta*) - theta-hat SE = sd(theta*)
Bias and SE. Bias is the mean of the bootstrap distribution minus the original statistic; for an unbiased estimator it should be near zero. The bootstrap SE is the SD of the bootstrap distribution and replaces the parametric standard error in non-Gaussian settings.

When the bootstrap is the wrong tool

If you have...Use instead
n < 10 with no modelThe bootstrap needs enough information in the sample to mimic the population. With n < 10 the resamples are too repetitive. Try a fully parametric model with a likelihood-based CI.
A statistic depending only on the maximum or minimumOrder-statistic-driven statistics have non-smooth sampling distributions; the bootstrap can be inconsistent. Use extreme-value asymptotics or subsampling.
Time-series or autocorrelated dataThe independent-resample assumption is broken. Use a block bootstrap (moving / circular / stationary) sized to the autocorrelation range.
A simple mean of mildly normal dataThe parametric t-CI is exact under normality, faster, and gives the same answer to two decimals. Use the Confidence Interval Calculator.
Heavy-tailed data with infinite variance (Cauchy-like)The bootstrap will systematically underestimate the spread. Use a truncated-mean estimator or a robust scale (MAD).
A regression coefficientThe bootstrap CI is fine, but for clean inference use the model-based CI. For non-Gaussian residuals, a residual or wild bootstrap is preferred.

Frequently asked questions

When should I use a bootstrap CI instead of a t-interval?

Use a bootstrap CI when the sampling distribution is not normal, the statistic is non-standard (median, ratio, percentile), or the sample is too small for the central limit theorem to kick in. Bootstrap is also the only practical option for many ML metrics like AUC or F1. Skip it when n is very small (under 20) or the data has heavy outliers.

What is the difference between percentile, BCa, and basic intervals?

Percentile uses the 2.5th and 97.5th quantiles of the bootstrap replicates, simple but biased for skewed statistics. BCa (bias-corrected and accelerated) adjusts for both bias and skew and is the preferred default. Basic (reverse percentile) reflects the percentiles around the original estimate. Normal uses the bootstrap standard error with a bias correction. The calculator shows all four side by side, and they match R's boot.ci() exactly.

How many bootstrap resamples do I need?

For confidence intervals, 2,000 resamples is the practical minimum and 10,000 is standard. For BCa or bootstrap hypothesis tests, use at least 5,000. The calculator runs 2,000 by default and lets you raise B up to 50,000; because it reproduces R's random-number generator exactly, the same seed and B give the same interval every time.

Why does BCa sometimes fall back to the percentile interval?

BCa needs a finite bias correction (z0) and acceleration (a). When the bootstrap distribution is degenerate, for example when every value is identical or a huge share of resamples land on the same value, z0 or a is not finite and BCa is undefined. The calculator detects this and shows the percentile interval instead, with a note.

Does this calculator match R's boot package?

Yes. It reproduces R's Mersenne-Twister and the R_unif_index sampler, so set.seed(seed); boot() draws the identical resamples. The normal, basic, and percentile intervals use boot's norm.inter interpolation, and BCa uses the Efron (1987) bias correction with the regression estimate of empirical influence when B ≥ n and the jackknife when B < n, matching boot::boot.ci(). Verified against R 4.6.0.

Go deeper

Numerical accuracy: R's Mersenne-Twister and R_unif_index resampling, reproduced exactly; the normal, basic, and percentile CIs use boot's norm.inter interpolation; BCa uses the Efron (1987) bias correction with the regression estimate of empirical influence when B ≥ n and the jackknife when B < n, matching boot::boot.ci(). Verified against R 4.6.0 to 1e-8 across every method.