ConvertCSV

Browser-based CSV transform

Sample CSV Rows

Pull a random sample of N rows from a CSV, with an optional seed for repeatable results. Everything runs locally in your browser — paste CSV, set options, preview, then copy or download.

Input

Paste CSV or upload a file

Options

Configure how this transform runs

Output Preview

Transformed CSV

Run the transform to preview CSV output here.

Sample CSV Rows

Sampling pulls a small, random slice from a file that is too large to inspect by eye, or that you want to test an import against before running the whole thing. This tool selects N data rows at random, keeps the header, and returns the chosen rows in their original file order so the sample still reads like the source.

The seed box is optional. Leave it blank for a new random selection each time, or enter a whole number to get the same rows on every run from the same input.

Key features

  • Random selection of data rows without replacement
  • Optional whole-number seed for repeatable results
  • Header kept and original row order preserved
  • Full file returned when the sample size is large enough

About the CSV to sampled CSV format

Rows are chosen without replacement, so no record appears twice. The output header matches the input header exactly. If the requested count is at least the number of data rows, every row is returned unchanged in its original order instead of being repeated to reach N.

The seed initialises a small seeded generator written in integer arithmetic. The same seed, the same input text, and the same count always select the same rows. Changing any one of those changes the selection. The generator is meant for repeatable test data, not for drawings that must be unpredictable.

How it works

The tool lists every data row position and runs a partial Fisher-Yates shuffle, which only moves the first N slots. Those N positions are then sorted back into file order and their rows are written out. A seed replaces the random source with a generator that produces the same sequence every time.

Common use cases

  • Pulling 200 random customer records to check a column mapping before running the full import.
  • Sending a colleague a fixed 50-row sample by passing along the seed with the input file.
  • Spot-checking a 40,000-line application log for unusual entries.
  • Creating a small fixture file for a bug report without exporting the full production table.

How to use this tool

  1. Paste the data, or upload the file, with its header line intact.
  2. Enter the number of records you want back.
  3. Enter a whole-number seed to repeat a selection, or leave the box empty for a new one.
  4. Compare the row count in the preview with the sample size you asked for.

Example

Input (eight event rows)

id,event
1,login
2,view
3,add_to_cart
4,checkout
5,logout
6,refund
7,view
8,login

Output (3 rows, seed 7)

id,event
1,login
2,view
8,login

Tips for best results

  • Keep the seed with the exact input file. The same seed on a re-exported file selects different rows, because the row positions have moved.
  • Filter before you sample when you need a particular kind of row. A 1 percent sample taken first can leave nothing that matches a rare condition.

Common errors and how to fix them

Sample size must be a whole number of 1 or more.
Enter a positive integer. Zero, a blank box, and decimals such as 2.5 are all rejected.
Seed must be a whole number, or left blank for a random sample.
Use digits only, such as 42. Text and decimals are refused; clear the box to go back to a random run.

Frequently asked questions

What if I ask for more rows than the file contains?

You get every data row back in the original order, with the header. Rows are never repeated to fill the gap.

What changes which rows are picked?

The seed, the sample size, and the input rows in their current order. Selection works on row positions, so inserting or deleting one row can change the sample even with the same seed.

For more background on data formats and conversion workflows, read our format guides.