CSV Sorter
Sort a CSV by any column ascending or descending, with optional numeric ordering. Copy or download the result.
Pure browser JavaScript. CSV parsing by PapaParse (MIT), self-hosted.
How to use this tool
- Paste CSV or upload a .csv file with a header row.
- Pick the column to sort by and the direction.
- Click Sort, then Copy or Download the sorted CSV.
Sort a CSV by any column ascending or descending, with optional numeric ordering. Copy or download the result.
How it works
This tool sorts the rows of a CSV file by any column you choose, in ascending or descending order. An optional numeric sort mode ensures that values like 2, 10, and 100 are ordered numerically rather than alphabetically (where 10 would sort before 2).
Paste or upload your CSV, choose the column to sort by, pick a direction, and toggle numeric mode if the column contains numbers. The header row is kept in place and only the data rows are sorted.
Use this to rank records (highest sales first, oldest entries first), prepare data for a presentation, or produce a sorted export before importing into another system.
The result can be downloaded as a CSV or copied to the clipboard.
Worked example
Sort a product list by price from highest to lowest
- Paste the product CSV into the tool.
- Select Price from the sort column dropdown.
- Choose Descending order.
- Enable numeric sorting.
- Click Sort and download the result.
The same CSV with rows reordered so the most expensive product appears first.
Common mistakes to avoid
- Forgetting to enable numeric mode when sorting a number column, causing 10 to appear before 9.
- Sorting a date column as text, which produces incorrect chronological order for non-ISO date formats.
- Sorting without numeric mode on a column that mixes blank cells and numbers, which puts blanks in unexpected positions.
Key terms
- Ascending order
- Sorted from lowest to highest (A to Z for text, smallest to largest for numbers).
- Numeric sort
- Interprets column values as numbers for ordering, so 10 comes after 9, not after 1.
- Stable sort
- When two rows have equal sort-key values, their original relative order is preserved.
Frequently asked questions
- How is numeric vs text sorting decided?
- With 'Numeric sort' on, columns whose values parse as numbers sort numerically; otherwise a lexicographic string comparison is used.
- Is the sort stable?
- It uses the browser's Array.sort, which is stable in all modern browsers, so equal keys keep their original order.