Extract a reproducible random sample from a large CSV dataset
Extract a reproducible random sample of rows from large CSV datasets.
🛡️ Your rows never leave your browser.
Why Onfyt: Fisher-Yates shuffle with configurable seed produces fully reproducible samples—paste the seed in your experiment log for auditability.
Interactive Sample Data
| id | customer | order_value |
|---|---|---|
| 1001 | Grace Kerubo | 450 |
| 1002 | Peter Njoroge | 320 |
| 1003 | Mercy Akinyi | 510 |
How this tool works
Before running an expensive ETL pipeline on 10 million rows, a data engineer needs a representative 1 000-row slice to validate the transformation logic. Before training a model, a data scientist needs a stratified test split. Before an audit, a compliance officer needs a documented random sample with a fixed seed so the same rows can be reproduced on demand. Three completely different use cases, all solved by the same primitive: uniform random sampling without replacement. DataFix implements Fisher-Yates shuffling with an optional seed integer. Setting the same seed always produces the same sample from the same input—critical for reproducible experiments where your sampling decision must be documented. Working with statistically sound random samples accelerates algorithm prototyping, model training, and visual inspection of large multi-gigabyte datasets without loading unmanageable memory footprints into local development environments. Representative random sampling enables rapid statistical exploration and model prototyping on large files without excessive memory consumption. Our algorithm implements reservoir sampling to ensure every row has an identical mathematical probability of selection in a single streaming pass, preserving original column headers and schema definitions intact. Generating unbiased random subsets of massive datasets enables fast exploratory data analysis, prototype validation, and algorithm testing. Reservoir sampling ensures that every record has an equal mathematical likelihood of inclusion without requiring excessive memory allocation. Fixed seed numbers guarantee identical subset rows across repeated validation runs in quality assurance testing.
Things that usually go wrong
- Without a fixed seed, each run produces a different sample.
- A sample from an unsorted file may not be representative if the data is ordered (e.g. all small orders at the top).
Edge cases we tested
🧪 Sample size larger than number of rows
Returns all rows (no replacement sampling); warning issued.
🧪 0% sample requested
Returns header row only with 0 data rows.
🧪 100% sample with shuffle
Returns all rows in shuffled order.
Frequently Asked Questions
Is the sampling truly random?
Yes — uniform random sampling without replacement using a cryptographically random seed (or your specified seed).
Can I sample by percentage?
Yes — enter '10%' to sample 10% of rows regardless of the total count.
Related tools
Reshape
Transpose CSV
Flip a CSV matrix by turning rows into columns and columns into rows.
Open Tool →
Reshape
Pivot a CSV
Summarise long-format CSV data into pivot tables grouped by row and column keys.
Open Tool →
Reshape
Group By and Count
Aggregate CSV rows by one or more group-by columns with count, sum, mean, min, or max.
Open Tool →