Use lists that match the assignment
Enter raw observations for Group A and Group B, separated as the calculator accepts, and keep all values in a common unit. Each group must contain at least two observations and the combined sample can contain at most 20. The observed statistic is mean(A) − mean(B), so the label order determines the sign shown with the result.
The calculation treats pooled observed values as fixed and enumerates all allocations having the original group sizes. It does not generate new data or sample from a fitted distribution. If the experiment used blocks, pairs, or restrictions on which units could receive which label, unrestricted reassignment may not match the randomization design.
What the exact p-value counts
For each allocation, the calculator recomputes the difference in group means. It counts allocations whose absolute difference is at least as large as the observed absolute difference, then divides by C(nA+nB,nA), the total number of fixed-size allocations. Ties at the observed extremeness are included, making the two-sided tail explicit.
The reported value is exact for this enumerated reference distribution, not exact for every scientific null. A sharp null of no effect under randomized assignment supports the randomization logic. Equal population means alone may not make labels exchangeable if the groups differ in spread, shape, or other features.
Interpret the result with the design in view
A small p-value says that few allowed reallocations produced a mean gap at least as extreme as observed under the stated exchangeability model. It is not the probability that the null hypothesis is true, nor a measure of how large or useful the difference is. Pair it with the observed mean difference and a domain-specific effect measure.
Because every allocation is enumerated, the p-value moves in discrete steps of 1 divided by the number of allocations. With tiny samples, even the most extreme arrangement may not produce a small p-value. This is a property of the design’s resolution, not a software failure. The calculator does not report a confidence interval or adjust for multiple analyses.
With m total allocations, the smallest nonzero two-sided p-value is constrained by the finite grid of attainable tail counts, and multiple allocations may tie. The source uses an absolute-tail rule and includes ties at the observed statistic. Report that convention because one-sided tails, mid-p adjustments, or a different test statistic can produce a different value from the same pooled data.
Check what was randomized
Confirm that the unit of randomization is the same unit represented by each list entry and that observations are independent at that level. If treatment was assigned by school, clinic, household, or batch, permuting individual records can overstate the valid allocations. Use a restricted or cluster-level method when the design requires it.
Report both lists or a reproducible data reference, group sizes, observed difference, number of allocations, and p-value convention. For observational groups, an exchangeability argument is not supplied by the calculator. A raw permutation calculation cannot remove confounding or justify a causal claim when assignment was not randomized.
Worked examples
These examples use all possible allocations, with the two-sided tail defined by absolute mean differences at least as large as observed.
Completely separated groups of three
Inputs: Group A = [1, 2, 3]; Group B = [4, 5, 6]
Calculation: Observed difference = 2 − 5 = −3; total allocations = C(6,3) = 20; 2 allocations have |difference| ≥ 3; p = 2/20 = 0.10.
Exact absolute-tail p-value = 0.10; observed Group A − Group B difference = −3 units.
Two pairs of values in each group
Inputs: Group A = [1, 2]; Group B = [4, 5]
Calculation: Observed difference = 1.5 − 4.5 = −3; total allocations = C(4,2) = 6; 2 allocations reach |difference| ≥ 3; p = 2/6 = 0.333333… .
Exact absolute-tail p-value = 0.3333333333; observed difference = −3 units.