Dataset Sampler

Take a reproducible random, stratified or systematic sample from a CSV of any size. Same seed = same sample. Group shares compared, sample saved as CSV.

Tool

Was this tool useful?

About this tool

About Dataset Sampler

Need 1,000 rows for a survey check, an audit or a quick model, but the file has millions? Open the CSV – it is read in chunks, so even very large files work. Choose simple random sampling, stratified sampling by a column (with proportional or equal group sizes) or systematic sampling (every k-th row). A seed makes the sample repeatable, and the stratified result shows each group’s share in the data and in the sample.

How it works

Random: reservoir sampling with a seeded generator (mulberry32). Stratified: a reservoir per group, then proportional (largest remainder) or equal allocation. Systematic: k = rows ÷ sample size, with a random start between 0 and k.

Example

400 customers in 4 regions, sample of 40, stratified by region: each region gets the same share in the sample as in the data (e.g. North 150 rows → 15).

How to use this tool

  1. Open or paste a CSV.
  2. Choose the method, the sample size and a seed (and the group column for stratified).
  3. Check the group shares and download the sample.

Frequently asked questions

Why use a seed?

So you or a colleague can create exactly the same sample again later – important for audits and research.

Which method should I use?

Random for most uses, stratified when small groups must be represented fairly, systematic for lists in a meaningful order such as invoices by date.

Is my data uploaded?

No. Everything runs in your browser and stays on this device.

Are my files uploaded by the Dataset Sampler?

No. The Dataset Sampler reads your files in your browser, so your data stays on your device. Very large files may be slow on older phones.