CSV Sorter
Order the rows of a CSV by one column, comparing values as text, natural text, numbers or dates.
Processed locally in your browser· Your data stays in your browser.
What is CSV Sorter?
Sorting a CSV as plain text puts 100 before 9 and mixes up dates. This tool lets you choose how values are compared: alphabetically, in natural order (file2 before file10), as numbers (currency symbols and thousands separators are understood) or as dates (ISO 2024-03-01 and 15/03/2024 formats).
The sort is stable: rows with equal keys keep their original relative order, so you can sort by several columns by running the tool once per column, from the least to the most important. Blank or unparseable values are always placed last, in either direction, and reported as a warning.
How does it work?
- Paste the CSV or open a file.
- Type the column to sort by (header name or number) and choose ascending or descending.
- Select how to compare: text, natural, number or date; tick case-sensitive if needed for text.
- Check the preview and copy or download the sorted CSV. The header row stays on top.
Common use cases
- Ranking a sales export by revenue from highest to lowest.
- Ordering event logs chronologically before analysis.
- Sorting a contact list alphabetically by last name.
- Putting version-like or numbered names (item2, item10) in a human order.
Examples
Try this input in the tool above:
id,name,email,city,age 1,Alice Martin,alice@example.com,Paris,34 2,Bob Durand,bob@example.com,"Lyon, France",28 3,Chloé Petit,chloe@example.com,Nice,41 4,David Roux,david@example.com,Paris,19
id,name,email,city,age 3,Chloé Petit,chloe@example.com,Nice,41 1,Alice Martin,alice@example.com,Paris,34 2,Bob Durand,bob@example.com,"Lyon, France",28 4,David Roux,david@example.com,Paris,19
Privacy
CSV Sorter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
Slash-separated dates are read day first (dd/mm/yyyy). Sorting by several keys requires running the tool repeatedly, starting with the least significant column.
Frequently asked questions
Why does numeric sorting matter?
As text, "100" sorts before "9" because the first character is compared. In number mode 9 comes first, and formats like 1,234.50 or $12 are understood.
Where do empty cells go?
Always at the end, whether you sort ascending or descending, so blanks never hide the data you are interested in.
How do I sort by two columns?
Sort by the secondary column first and then by the main column. Because the sort is stable, ties in the main column keep the secondary order.
Related tools
CSV Filter
Keep only the CSV rows that match a condition on one column, or on any column at once.
JSON & Data
CSV Deduplicator
Find and remove duplicate rows in a CSV, comparing whole rows or only the columns you choose.
JSON & Data
CSV Column Extractor
Keep only the columns you need from a CSV, chosen by header name, position or range, in the order you list them.
JSON & Data
CSV Viewer
Paste CSV text or open a .csv file and inspect it as a table, with row and column counts and the detected delimiter.
JSON & Data
CSV Formatter
Re-serialize messy CSV into a consistent file: same quoting rules, trimmed cells, one delimiter and one line-ending style.
JSON & Data
Sort Lines
Order any list one item per line: A to Z, Z to A, natural, numeric or by length.
Text Tools
CSV Merger
Combine two CSV texts into one, either by stacking their rows or by placing them next to each other.
JSON & Data