GenerateRandomSearch

Bootstrap Sample Generator

You measured ten things and got an average of 15.6. How much of that is the thing you measured, and how much is which ten you happened to get? Bootstrapping answers that with no formula and no assumptions about the shape of the data: draw a new sample of the same size from your own numbers, with replacement, a thousand times, and look at how much the average moves. The spread you see is sampling error made visible.

What this generator does

Resamples your data rather than generating new data. The random sample generator here draws from a range; the normal distribution generator produces values from a bell curve. This takes numbers you already have and draws from *them*, with replacement, which is what simulates having collected a different sample from the same population — and needs no assumption that the data is normal.

How to use this tool

  1. Paste your numbers, one per line or comma-separated.
  2. Choose the mean or the median, and how many resamples.
  3. Read the interval — 95% of resamples fall inside it.

Understanding the controls

Your sample
One number per line or comma-separated. At least two values. Everything stays in your browser.
How many resamples
A thousand is plenty to see the shape. More narrows the estimate of the interval itself, not the interval.
Statistic
The mean or the median. The median is where bootstrapping earns its keep — there is no simple textbook formula for its confidence interval, and this needs none.

Worked examples

Ten values averaging 15.6
A 95% interval typically several units wide — that width is the sampling error.
A sample where every value is identical
Every resample gives the same answer; the interval has zero width.
The median of an even-sized sample
The midpoint of the two middle values, resampled like any other statistic.
Adding more data
Narrows the interval. Adding more resamples does not.

Common use cases

  • Putting an honest range around an average from a small sample
  • Showing why a difference between two small samples may be noise
  • Teaching sampling error without needing a formula first
  • Checking whether a result is stable before reporting it
  • Getting an interval for a median, where the textbook formula does not exist

How this generator works

Each resample draws as many values as your sample contains, with replacement, so it may take one value three times and skip another entirely. That is what simulates a different draw from the same population. The chosen statistic is computed for every resample, the results are sorted, and the 2.5th and 97.5th percentiles are reported as the interval. Every replicate is checked to lie within the range of your original data, because a resample can only contain values that were in it.

Randomness and fairness

Every resample is drawn using the browser's cryptographically secure generator. Because the draw is random, the interval moves a little between runs — resample again and watch how much, since that movement is itself a measure of whether you have used enough replicates.

For how randomness is produced across the whole site, see how Generate Random works.

Assumptions this tool makes

  • The values are independent observations from the population you care about, so resampling them stands in for resampling the population.

Limitations and good to know

  • It shows the uncertainty already in your sample. It cannot tell you whether the sample was collected well, and no amount of resampling fixes a biased one.
  • Very small samples give unreliable intervals — with five values there is not much to resample from.
  • The percentile interval used here is the simplest kind; bias-corrected variants exist and are not implemented.
  • It assumes your observations are independent of each other.
  • Neither your data nor the interval is kept between visits; record the interval alongside the figure you are reporting.

Common mistakes

Resampling without replacement
That just reorders your data and every resample gives the identical answer. With replacement is the whole mechanism.
Adding resamples to narrow the interval
More resamples estimate the same interval more precisely. Only more *data* narrows it.
Bootstrapping a biased sample
It faithfully reproduces the bias. Bootstrapping quantifies sampling error, not sampling method.

Practical tips

  • Report the interval alongside the average rather than the average alone.
  • If the interval is wide enough to include the answer you were hoping to rule out, that is the finding.
  • Try the median as well as the mean where the data has outliers — the two intervals often differ instructively.

Privacy and your data

Your numbers stay in your browser. Nothing is uploaded, nothing is stored between visits, and none of it is written into the page address — which matters when the numbers are measurements or results. Analytics records that the tool ran and how many resamples it did, never a value.

Frequently asked questions

Why draw with replacement?
Because drawing without replacement just gives your original sample back in a different order. Allowing repeats is what makes each resample a plausible alternative sample from the same population.
Is this a confidence interval?
It is a percentile bootstrap interval, which is the simplest kind and behaves well for the mean and median of reasonable samples. It is not identical to a textbook confidence interval, and for small or very skewed samples the difference can matter.
How many values do I need?
More than two, and realistically more than ten before the interval means much. Bootstrapping cannot manufacture information that is not in the sample.