Randomly sample a CSV
Paste or upload a CSV file and specify the desired number of rows: the tool draws a random sample of rows (keeping the header), useful for quickly testing a process.
How it works
Handy when you want to test a process, a script, or an import before applying it to a full file of several thousand rows: rather than copying the first 20 rows (which aren't necessarily representative), this tool draws a truly random sample. Paste or upload your CSV, specify the desired number of rows, click "Generate sample" and get a smaller file with the original header.
Do the drawn rows stay in their original order?
Yes: rows are randomly selected without replacement (each row can only be drawn once), but they are then reordered according to their original position in the file, so the sample stays easy to compare visually with the source data.
What happens if I ask for more rows than are in the file?
The tool then simply returns all available rows (with the header), with no error: asking for a sample larger than the whole file amounts to asking for the whole file.
Processing is entirely local, performed in your browser via WebAssembly: your file never leaves your computer.