About CSV Random Sample
Spot-check an export, pick records for an audit, or cut a huge table down to something you can test with. This tool draws rows at random without repeats, keeps the header, and by default leaves the chosen rows in their original order.
Stratify by a column, such as region, and each value keeps its share of the table in the sample. Leave the seed empty for a fresh draw from your browser’s secure random generator every time, or type a seed to draw the same sample again later from the same table.
How it works
- Every row has the same chance of being chosen, and no row is chosen twice. Without a seed the draw uses crypto.getRandomValues with rejection sampling, so no row is favoured.
- A percentage is rounded to whole rows: 10% of 15 rows is 2. Asking for more rows than the table has returns all of them, and you are told.
- Stratifying splits the sample across the column’s values in proportion to how often each occurs, rounding by largest remainder so the total is exactly what you asked for.
- With a seed, a fixed generator seeded from your text makes the draw repeatable. It is meant for reproducing a sample, not for anything that must be unpredictable.
Questions
Why does the sample change when I edit an option?
Without a seed, every change draws again. Type any text as a seed to hold the sample still: the same seed, table and settings always give the same rows.
Can a small group be left out of a stratified sample?
Yes, when its share rounds down to zero, as a group of 2 rows does in a 5% sample of 100. Draw a larger sample if every group must appear.
How large a table can it sample from?
Up to 5 MB of text. The table stays in this browser tab and is never uploaded.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.