Sample Ratio Mismatch: How to Check Your A/B Test Split
A sample ratio mismatch (SRM) means your A/B test planned one traffic split and got another. You set 50/50, but the visitor counts came back further apart than chance allows. When that happens, the conversion numbers can't be trusted, no matter how good the winner looks. The fix starts with one chi-square test on the counts, and it takes about two minutes by hand.
This started as a post our AI agent wrote on Moltbook, a social network where only AI agents post. It walked through the arithmetic of a sample ratio check. Other agents replied, and two of their points made the advice better: check the split at each stage of the funnel, and never run the check on a filtered group. Both are in here.
What a sample ratio mismatch is
Every A/B test assigns visitors to arms at random. If you tell it to send half to the control and half to the variant, you won't get exactly half each. Flip a coin 1,000 times and you won't get exactly 500 heads either. Some drift is normal.
The question is whether the drift is bigger than chance would give you. When it is, something upstream is dropping or adding people in one arm more than the other. And the people who go missing are not random. They are the slow phones, the fast bouncers, the bots, the visitors on one browser.
That is why an uneven traffic split breaks the whole test. The two groups no longer hold the same kind of people. If you're new to how tests are supposed to work, our guide to what A/B testing is covers the basics first.
The chi-square test for an A/B split, step by step
The standard SRM check is a chi-square goodness-of-fit test. You don't need a stats package. You need the planned split and the count of visitors assigned to each arm.
First, work out the expected count for each arm: total visitors times the planned share. Then for each arm, take the observed count minus the expected count, square it, and divide by the expected count. Add those numbers up across all arms. That sum is your chi-square statistic. With two arms you have one degree of freedom, so you compare the sum to a fixed cutoff.
The cutoffs you'll see most often at one degree of freedom are 3.84 (p = 0.05), 6.63 (p = 0.01), and 10.83 (p = 0.001). Many teams use the strict 10.83 line for SRM. The reason is volume: if you run the check on every test, a 0.05 cutoff will raise a false alarm on about one test in twenty. A stricter line means that when it trips, you can be fairly sure the split is really broken.
A worked example with real numbers
Say you planned a 50/50 split and 10,000 visitors were assigned. You expect 5,000 in each arm. You got 5,150 in the control and 4,850 in the variant.
Control: 5,150 minus 5,000 is 150. 150 squared is 22,500. Divided by 5,000, that's 4.5.
Variant: 4,850 minus 5,000 is minus 150. Squared, that's 22,500 again. Divided by 5,000, that's 4.5.
Add them: 4.5 plus 4.5 is 9.0. That clears 3.84 and 6.63 easily, so at the usual levels it is a mismatch. The p-value is about 0.0027. It does not clear 10.83, so under the strict p < 0.001 rule it sits in the gray zone. We'd treat that as a reason to go looking for a cause before reading any result, not as a pass.
Now push the gap a little further: 5,230 and 4,770. Each arm is 230 off. 230 squared is 52,900, divided by 5,000 is 10.58, and two of those make 21.16. That is far past 10.83, with a p-value around 0.000004. That split is broken, full stop.
For contrast, 5,050 and 4,950 gives 2,500 divided by 5,000 twice, or 0.5 plus 0.5, which is 1.0. The p-value is about 0.32. That's ordinary coin-flip drift, and you can move on.
The same math works for an uneven planned split. Say you send 80 percent to the control and 20 percent to a risky variant, and 10,000 visitors come through. You expect 8,000 and 2,000. You got 8,160 and 1,840. Control: 160 squared is 25,600, divided by 8,000 is 3.2. Variant: 25,600 divided by 2,000 is 12.8. Total 16.0, well past 10.83. Notice the smaller arm does most of the work. The same 160-visitor gap matters four times as much there, because it is a bigger share of what you expected.
One more thing to know: the check gets more sensitive as traffic grows. With 20,000 visitors on a 50/50 split, 10,240 and 9,760 gives 11.52, which trips the strict line, even though each arm is only 1.2 percent off its target. Big tests can't hide small leaks.
Common causes of an uneven traffic split
When the check fails, the cause is almost always in how visitors reach the page or get counted, not in the random number generator. These are the ones we see most:
- Redirects. If the variant lives at a different URL, the redirect adds a step. Slow connections and some browsers drop out during it, so the variant arm comes up short. Our agent's own strangest case was a redirect that only broke on one browser.
- Bots. Crawlers and uptime checkers often hit one URL directly. If they land on the control and get counted, the control arm swells with visitors who were never going to buy.
- Caching. A CDN or page cache can serve the control to people who were assigned the variant, or serve one version to everyone for a while. The assignment says one thing, and the visitor sees another.
- Late-firing scripts. If the tracking script loads after a heavy variant renders, fast bouncers leave before they're counted. The heavier arm loses exactly the people least likely to convert, which makes it look better than it is.
- Assignment on a page some visitors never reach. If people are assigned on page two, but only some of them get to page two in each arm (because of a pop-up, a different link, or a page-one change), you're splitting two different crowds.
Check the split at every stage
This is the point the other agents added, and it's the most useful one. Don't check the split once. Check it at three stages: visitors assigned, visitors who actually saw the page, and visitors who got counted in your analysis.
If the ratio is fine at assignment and breaks at exposure, the page itself is losing people unevenly. A heavier variant that loads slowly on mobile does this a lot. If it's fine at exposure and breaks at analysis, your logging or your filters are the problem. One agent put it well: a mismatch that only shows up after filtering points to exclusions that depend on the treatment, even when the randomizing itself is sound.
That leads to the most common mistake we see: running the SRM check on the wrong group. Run it on assigned visitors, not on people who converted or reached a later page. A variant that sends more people to checkout will of course have more people at checkout. That isn't a mismatch. It's the effect you're trying to measure.
When you do find a skew, slice it. Look at the split by device, by browser, and by traffic source. The problem usually hides in one slice: say, the split is perfect on desktop and off by 8 percent on one mobile browser. That tells you where to look.
What to do when the check fails
Don't read the conversion result, not even to peek. A winning variant on a broken split is just a story.
Find the cause, fix it, and restart the test with fresh counts. It's tempting to reweight the arms or throw out the bad slice and keep the rest, but that rarely works. You can't patch a biased sample with math, because you don't know what the missing visitors would have done. Restarting costs you time. Shipping a fake winner costs you every decision built on it later.
Restarting also means you need enough traffic again, so it helps to know your numbers up front. See how to work out A/B testing sample size and how long to run an A/B test before you relaunch.
Make the check automatic
The best habit is to run the SRM check before every readout, even on ties. A clean tie and a broken tie look the same until you check the counts. Write down the planned split when you launch, pull the assigned counts per arm, and run the sum. It's three lines in a spreadsheet.
If you'd rather not do it by hand, many testing tools can run it for you. In VariFlask's continuous loops, every round runs this check at the 10.83 line, and a round with a bad split can't promote a winner. It waits instead. If you're still choosing how your team decides winners, our piece on Bayesian vs frequentist testing is a good next read.
Frequently asked questions
What is a sample ratio mismatch in an A/B test?
It's when the number of visitors in each arm is further from your planned split than random chance would allow. For example, you planned 50/50 and got 5,230 and 4,770 out of 10,000. It means something is dropping or adding visitors unevenly, so the result can't be trusted.
How do I run a chi-square test on my A/B split?
For each arm, subtract the expected count from the observed count, square it, and divide by the expected count. Add the results. With two arms, compare the sum to 3.84 for p < 0.05, or to 10.83 for the stricter p < 0.001 line many teams use for SRM.
What threshold should I use for an SRM check?
Many teams use p < 0.001, a chi-square above 10.83 with two arms. It keeps false alarms rare when you check every test. If a result lands between 3.84 and 10.83, treat it as a reason to look for a cause before reading the result.
What causes an uneven traffic split?
The usual causes are redirects that lose slow visitors, bots hitting one URL, caches serving the wrong version, tracking scripts that fire late, and assigning visitors on a page some of them never reach.
Can I fix the data instead of restarting the test?
Usually not. You don't know what the missing visitors would have done, so reweighting or dropping a slice can't undo the bias. Find the cause, fix it, and restart with fresh counts.
Tests that check their own split
VariFlask checks the traffic split on every loop round before it promotes a winner. Paste your URL to see it work on a real page.
Get started free →