Study and Productivity

How to Draw a Random Sample or Split an A/B Test Fairly and Reproducibly

Simple, systematic and stratified sampling explained, how to split a list into balanced A/B groups, and why a seed makes the selection auditable.

Saizul Amin
Saizul Amin2 Nov 2026 · 3 min read
How to Draw a Random Sample or Split an A/B Test Fairly and Reproducibly

How to Draw a Random Sample or Split an A/B Test Fairly and Reproducibly

Random selection is the backbone of fair experiments, audits and surveys. Done carelessly, it is neither random nor repeatable. The Random Sample and A/B Group Splitter does it properly in your browser.

Why not RAND() in Excel?

Sorting by a RAND() column works once, but the numbers change every time the sheet recalculates, so nobody can check or repeat the selection later. A seeded generator produces the same sequence every time from the same seed.

Choosing a method

MethodBest for
Simple randomA uniform list, any purpose
SystematicA long list with no pattern in its order
StratifiedGroups that must all be represented, such as regions
Group splitExperiments with control and variants

Stratified sampling

If 80% of customers are on the Free plan and 20% on Pro, a simple sample of 50 might contain very few Pro customers. Stratifying by plan guarantees each group is represented, either proportionally (40 Free, 10 Pro) or equally (25 each) when you want to compare the groups.

Balanced A/B groups

Randomly assigning people to groups usually balances them, but with small lists chance can put most of one region in one group. Balancing by a column splits each value of that column separately, which statisticians call block randomisation. The balance check then compares the groups on every column.

Reproducibility

Write down the list version, the method and the seed. Anyone can repeat the selection and get the same result, which makes an audit sample or an experiment defensible.

A worked example

Sixty customers across four regions, split into Control, Variant A and Variant B, balanced by region, with the seed 2026-11-02: each group gets 20 customers, five from every region.

After the split

Keep the assignment file with your experiment notes, analyse results by group, and never move people between groups after seeing early results.

Work in small, saved steps

Every tool in this series keeps your work as a project in your own browser. Make a change, check the preview, and use undo (Ctrl+Z) or redo (Ctrl+Y) freely; nothing is lost while you experiment. Before a big change, save a named copy from the Projects menu, so you can return to it later or compare two versions side by side. Export the project file when you want to move it to another computer or keep a backup, and import it again whenever you need it.

How big should the sample be?

This tool selects rows; it does not decide how many you need. For surveys, the margin of error depends on the sample size, not the population size, once the population is large: about 385 responses give a 5% margin at 95% confidence. For A/B tests, the size depends on the effect you want to detect. Work out the number first, then draw it here.

Privacy by design

The processing happens in the page itself. Files you open are read by code running on your device, results are calculated locally, and nothing is sent to a server or stored in a cloud account. That makes the tool suitable for customer lists, financial data and other material you would not upload to an unknown website. If a component such as a file reader or a map outline is downloaded from a public CDN, only that open-source code or public data is fetched, never your own content.

Share the result clearly

When you pass the output to colleagues, say where the data came from, when it was exported, and which settings you used, so that someone else can repeat the work and get the same answer. Keep the original file unchanged and store the cleaned or calculated version separately. A short note with the assumptions, filters and date saves a lot of questions later and makes the result easier to trust.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages