Take a random sample of rows from a CSV

Pick a random 100 rows, or 5 percent, from a CSV of any size — for a test file, a spot check, or a survey — with nothing uploaded.

Random sample of a CSVRunning on your device

Source

or drag one here · it stays on your device

Result

Add a file, choose how many rows, and the sample appears here before anything downloads.

Download

Have a look at the result before downloading it.

How this works
  1. Add your file. Drop a CSV onto the page, or pick one.
  2. Choose the sample size. A number of rows or a percentage.
  3. Take the sample. Check the preview, then download.
What it cannot do
  • A random sample is random: it does not balance categories or dates, and says so.
Questions
How do I say how many rows I want?
As a number of rows or as a percentage — 200 rows, or 5 percent of the file.
Will I get the same sample twice?
Only if you ask to: give the sample a seed number and the same seed on the same file gives the same rows, so a colleague can reproduce it.
Does the sample keep the heading row?
Yes, always. The sample is a smaller file with the same columns.
Does it change any values?
No. When you take a random sample of rows from a CSV here, every cell is carried through as the exact text in your file — leading zeros, long numbers and dates included. To take a random sample of rows from a CSV is to change the arrangement, never a value: the download is written fresh with standard quoting and nothing in it is retyped.
Is my file uploaded anywhere?
No. When you take a random sample of rows from a CSV here, the work happens inside this page and the browser is told to block outbound connections, so there is no upload to intercept. Watch the Network tab of your developer tools while you take a random sample of rows from a CSV: the only requests are for this site’s own code, and none carries your file.

Your file is processed in this page and never uploaded — the privacy page shows how to confirm that yourself.