Staaarter

CSV Value Shuffler

Flattens every data cell (excluding the header) into one list, shuffles it with a crypto.getRandomValues-backed Fisher-Yates pass, and reassigns the values back into the same row/column shape: scrambling which value belongs to which row and column entirely. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
reshaperandom

Overview

Introduction

Some testing and demo scenarios need data that has the same shape and value distribution as a real dataset but no real relationship between fields. This tool scrambles every value in the grid independently to produce exactly that.

It's the most disruptive of the three CSV shufflers in this category, since it ignores row and column boundaries entirely.

What Is CSV Value Shuffler?

A whole-grid value scrambler: every data cell (the header is excluded) is flattened into a single list, shuffled, and reassigned back into the original grid's row/column shape.

Unlike row or column shuffling, a value's new position bears no relationship to its original row or column.

How CSV Value Shuffler Works

The CSV is parsed, the header is split off, and the remaining data grid is padded to a rectangle. Every cell is flattened into one flat array, which is shuffled in place with a Fisher-Yates pass drawing from crypto.getRandomValues().

The shuffled flat array is then sliced back into rows of the original width, reproducing the same row/column dimensions with completely scrambled contents.

When To Use CSV Value Shuffler

Use it when you need a dataset with the same shape and value pool as a real one, but with no inferable relationship between fields, for testing or demoing without exposing real record structure.

It's not a substitute for row or column shuffling when you actually want to preserve each record's internal consistency.

Often used alongside CSV Row Shuffler and CSV Column Shuffler.

Features

Advantages

  • Produces a fully decorrelated version of a dataset while preserving its exact dimensions and value pool.
  • Uses a cryptographically strong random source rather than Math.random for an unbiased shuffle.
  • Clearly documented as the most disruptive of the shuffle family, so it's not mistaken for a row/column shuffle.

Limitations

  • It destroys every relationship between a row's fields; the output is not meant to represent realistic records anymore.
  • Requires at least one data row; a CSV with only a header row has nothing to shuffle.

Examples

Scrambling a small grid's values

Input

id,name
1,Ada
2,Alan

Output

id,name
Alan,1
Ada,2

All four data cells (1, Ada, 2, Alan) were pooled together and reassigned randomly back into the same 2x2 shape: note "Alan" and "1" no longer share a row the way they didn't originally either.

Best Practices & Notes

Best Practices

  • Use CSV Row Shuffler or CSV Column Shuffler instead if you need to preserve each record's internal field relationships.
  • Reach for this specifically when you want a decorrelated test fixture with the same value pool and dimensions as the source.
  • Don't use this output to represent real records: the row/column relationships are intentionally destroyed.

Developer Notes

The flatten-shuffle-reshape approach (Array.flat(), a single Fisher-Yates pass, then slicing back into fixed-width chunks) guarantees every original value appears exactly once in the output, just relocated, rather than risking duplication or loss the way independent per-cell randomization would.

CSV Value Shuffler Use Cases

  • Generating a decorrelated test fixture that has the same shape and values as production data but no real relationships
  • Creating obfuscated demo data where the original row-to-value associations shouldn't be reconstructable
  • Stress-testing a system's tolerance for statistically similar but structurally meaningless data

Common Mistakes

  • Confusing this with CSV Row Shuffler or CSV Column Shuffler and being surprised that individual rows no longer make internal sense.
  • Using this output as if it still represented real, coherent records: the whole point is that it no longer does.

Tips

  • If you only need to hide row order (not scramble individual fields), use CSV Row Shuffler instead.
  • Compare the shuffled output against the original with CSV Comparator to confirm the value pool is unchanged, only reassigned.

References

Frequently Asked Questions