Dataset Row Sampler and Splitter

Take repeatable CSV samples or create separate train and test downloads.

On-device No sign-up Free to use

Sample or split rows controls

Showing an example. Edit to see your own.

?

Paste a CSV with a heading row. Up to 100,000 data rows, 500 columns and 2,000,000 cells. Every value is kept as text, so a leading zero survives.

Drop your CSV file here

or choose one from your device

One UTF-8 CSV or TSV file with a heading row. A chosen file is used instead of the pasted rows.

    ?

    The random and split methods are reproducible: the same seed and row count always give the same assignment.

    ?

    Used by the random sample. It cannot exceed the number of data rows.

    ?

    Used by the every-nth method. A value of 3 with a start row of 1 keeps rows 1, 4, 7 and so on.

    ?

    The first row the every-nth method can keep. It cannot be larger than the nth value.

    ?

    Used by the train and test split. The row count is rounded and clamped so both parts hold at least one row.

    ?

    Set the delimiter yourself when a quoted cell confuses detection.

    ?

    A cell whose first visible character is = + - or @ receives an apostrophe in both downloads. Turn it off to keep the raw value.

    More options
    ?

    A whole number from 0 to 4294967295 for the mulberry32 generator.

    Processed in your browser. Your inputs stay on this device.

    Result

    Showing an example.

    Keep alternate rows in source order.

    The selected CSV contains IDs 1 and 3. The remainder contains IDs 2 and 4, with both exports retaining source order.

    Loading the tool. Your result will appear here.

    https://usefreetools.net/dataset-row-sampler-splitter · 20 November 2026

    Was this helpful?

    How to use Dataset Row Sampler and Splitter

    1. Paste a rectangular CSV/TSV table with unique headers, or choose its UTF-8 file.
    2. Choose a seeded random sample, every-nth sample or seeded train/test split.
    3. Set the sample size, interval/start row or train percentage for that mode, and a random seed where used.
    4. Review output counts and download both the sample/remainder or train/test parts. Keep the source order and settings with them when reproducibility matters.

    Example: Dataset Row Sampler and Splitter

    Keep alternate rows in source order.

    You add
    CSV: id,name 1,A 2,B 3,C 4,D. Method: Every nth; interval: 2; start row: 1.
    You get
    The selected CSV contains IDs 1 and 3. The remainder contains IDs 2 and 4, with both exports retaining source order.

    Options

    CSV rows
    Paste a CSV with a heading row. Up to 100,000 data rows, 500 columns and 2,000,000 cells. Every value is kept as text, so a leading zero survives.
    Sampling method
    Random sampling and train/test splitting repeat for the same source order, seed, mode and settings. Reordering the source changes which records occupy the selected positions.
    Sample size
    Used by the random sample. It cannot exceed the number of data rows.
    Every nth row
    Used by the every-nth method. A value of 3 with a start row of 1 keeps rows 1, 4, 7 and so on.
    Start at row
    The first row the every-nth method can keep. It cannot be larger than the nth value.
    Train percentage
    Used by the train and test split. The row count is rounded and clamped so both parts hold at least one row.
    Random seed
    A whole number from 0 to 4294967295 for the mulberry32 generator.
    Delimiter
    For sampling, choose the separator between source text cells. An automatic choice, when offered, must still be checked against quoted and multiline values.
    Protect spreadsheet formulas
    The sampling CSV export can prefix formula-like source text, including after leading whitespace. This changes the stored text; review the downloaded cells before using them.

    Supported inputs and limits

    • UTF-8 CSV/TSV with unique headings: files up to 20 MiB or pasted text up to 20,000,000 characters, at most 100,000 rows, 500 columns and 2,000,000 cells.
    • A selected file replaces pasted text.
    • The same source order, seed and settings reproduce random selections; every-nth selection follows its start row.
    • Both outputs retain source order and contain disjoint source rows.
    • Stratification and related-record leakage checks are not provided.
    More details

    CSV formula protection can prefix exported text.

    Where your input is processed

    This tool does not upload your inputs. See the limits for anything saved on your device.

    A sample is not a representativeness guarantee

    A selected subset can miss rare cases or preserve bias already present in the source. This tool chooses rows; it does not stratify on labels or prove that a train/test split avoids related-record leakage. Review the assignment against the job that needs the sample.

    Preserve the remainder and the selection recipe

    Both selected and remaining records are available. Keep the original row order, method, interval or seed when you need to reproduce an extraction. Formula protection can change exported text, so retain its setting with the recipe.

    Questions about Dataset Row Sampler and Splitter

    Will the same seed produce the same rows?

    Yes, with the same input order, mode and settings. Editing or reordering the source can change which rows that seed selects.

    Can a record appear in both exports?

    No. The sample/remainder or train/test parts are disjoint and together contain all source records.

    Does random sampling remove selection bias automatically?

    No. It only applies the selected algorithm to the rows you supplied. Review the source population and the purpose of the sample.

    Page updated · Project managed by Tony Hines · Report a problem with Dataset Row Sampler and Splitter