Sample Ratio Mismatch Calculator
What SRM reveals about your experiment
Nothing invalidates an A/B test faster than a broken traffic split. Sample ratio mismatch (SRM) means the observed group sizes stray from the allocation you configured, a red flag for instrument bugs, redirect losses, or caching skew. A/B testers and platform teams run this check on almost every experiment.
Statistically, an SRM check is a chi-square goodness-of-fit test comparing observed sample sizes against the expected allocation. It validates the machinery before anyone trusts the outcome metrics. If the split is broken, every p-value that follows inherits the damage.
The chi-square check, with numbers
The statistic is chi-square = sum of (observed - expected)^2 / expected across your variants. Expect a 50/50 split and observe 5,050 against 4,950 visitors: expected counts are 5,000 each, so chi-square = 50^2/5000 + 50^2/5000 = 1.0, with p about 0.32 and no mismatch.
Unequal designs work identically. With a planned 80/20 split, observing 7,960 and 2,040 instead of 8,000 and 2,000 gives 0.2 + 0.8 = 1.0 again. When p falls below 0.001, treat the experiment as invalid and hunt for the twist bug.
Checking your test, step by step
Enter your Sample sizes, one value per variant, in the order the allocation was configured. Then set the Target allocation: pick Equal for symmetric tests, or Unequal and type the Target ratios your platform was configured to deliver.
Press Check for SRM and read the chi-square statistic with its p-value. A p-value below 0.001 almost never happens by chance, so stop reading metrics and debug assignment instead. Common culprits are bots, duplicate redirects, and caching layers that pin users to one variant.
Frequently Asked Questions
What is sample ratio mismatch in plain terms?
It is the failure of observed group sizes to match the allocation you configured, such as an even split landing at 55/45. It almost always reveals a bug, not genuine randomness.
Why is chi-square the right test here?
Because comparing observed counts against an expected allocation is exactly a chi-square goodness-of-fit problem. It compresses how far realized traffic strays from the plan into one familiar statistic.
What p-value should make me suspicious?
Use a strict threshold: a p-value below 0.001 signals an almost certain mismatch, since genuine 50/50 splits drift that far less than one time in a thousand. Investigate instrumentation before reading any metric.
Can SRM appear with unequal allocation?
Yes. The test compares observed sizes to whatever target ratios you set, so a planned 80/20 split counts as mismatched when it drifts materially from those expected counts.
If SRM is found, are results meaningless?
Generally treat them as unusable, because the skewed mix can bias every downstream metric in unknown directions. Fix the assignment bug, then rerun the experiment on clean traffic.