CSV Sorter
Paste a CSV and choose one or more sort keys with direction (A→Z or Z→A) and type (text or numeric). Supports multi-key stable sorting. Download the result. Runs entirely in your browser.
Sort rows in a delimited table by one or more columns. Each sort key can use ascending or descending order, and a key can be compared as text or as a number.
How to sort CSV rows
- Paste the table and choose its delimiter.
- Choose whether the first row is a header.
- Select a column for the first sort rule and choose ascending or descending order.
- Enable Numeric when that key should be compared with parseFloat instead of text comparison.
- Add more sort keys if needed and run the sort.
How multiple sort keys work
Rules are evaluated in the order shown. If the first key compares equal, the next key is used, continuing until a difference is found or all selected keys are equal.
Text sorting uses localeCompare. Numeric sorting subtracts parseFloat results; if that comparison produces NaN, the tool treats the comparison as equal for that key and proceeds to the next rule.
Privacy and limitations
Sorting is performed locally in the browser and the table is not intentionally sent to a server. Numeric mode uses JavaScript parseFloat rather than locale-aware number parsing, so values with localized thousands or decimal conventions may not sort as expected.
Frequently asked questions
Can I sort by more than one column?
Yes. Add multiple sort keys; they are evaluated from the first rule to the last.
Is the header row sorted too?
Not when First row as header is enabled. The first row stays at the top.
What does Numeric do?
It compares the selected cell values using parseFloat rather than localeCompare.
What happens when numeric values cannot be parsed?
That key is treated as equal for that pair, so a later sort key may decide the order.
Does the output keep my delimiter?
Yes. The selected delimiter is also used when the sorted table is serialized.