MakeMyStats
Blog
← All tools

CSV Sort & Group

Drop a CSV and sort it by one or more columns. Add as many sort keys as you need, pick ascending or descending per key, and optionally group rows by a column so rows with the same value stay together. Your file never leaves your browser.

Drop a CSV or TSV file here, or click to select.

CSV, TSV · Max 2 GB

How to use CSV Sort & Group

  1. 1

    Drop your CSV

    Drag a .csv or .tsv file onto the dropzone. PapaParse parses it in your browser — nothing is uploaded.

  2. 2

    Pick sort keys in order of precedence

    The first key is the primary sort, the second breaks ties, and so on. Add as many keys as you need with the + Add sort key button, pick ascending or descending per key, and use the arrow buttons to reorder them.

  3. 3

    Optional: group by a column

    Turn on Group by to keep every row that shares a value in that column adjacent in the output. The group column becomes the implicit primary sort; your ordered keys break ties within each group.

  4. 4

    Review the live preview

    The virtualized DataTable shows the sorted result as you change keys. Group counts are shown above the table when grouping is on.

  5. 5

    Download the sorted CSV

    Click Download sorted CSV to save the result. Column order is preserved from the original file; only row order changes.

Frequently asked questions

Does this tool upload my CSV?
No. Every parse, transform, and download runs entirely in your browser using JavaScript and Web Workers. The file never leaves your device — there is no upload endpoint and no server-side processing.
Is the sort stable?
Yes. Rows that tie on every sort key retain their original relative order. This makes repeated sorts compose predictably — sorting by state and then by city gives you cities grouped within states with the original row order preserved inside each city.
How are numbers and strings compared?
Numeric values are compared numerically. Strings use a locale-aware natural compare, so item2 sorts before item10 and A sorts before B regardless of case. Empty cells (null or blank) always sink to the bottom so missing data is easy to spot.
What is the difference between Group by and adding that column as the first sort key?
Functionally they both produce contiguous groups. Group by also displays the per-group counts above the table and never sorts descending — it's a thin UX layer on top of the same sort primitive. Use Group by when you want the summary; use a sort key when you want explicit direction control.
How big a CSV can it sort?
MakeMyStats uses streaming parsers (PapaParse worker mode for CSV, SheetJS for Excel) and virtualized rendering (react-window) so the UI stays responsive on multi-hundred-megabyte files. The hard ceiling is your browser's memory budget — usually 1–2 GB on desktop.