CSV Sorter
Sort a CSV file by any column - free, no upload.
What this tool does
Paste your CSV, choose a column, choose text or number sorting and a direction, and the rows re-sort instantly - the header row always stays on top.
Sorts CSV rows by any column, chosen from the actual header row in your data.
Supports both text sorting (alphabetical) and true numeric sorting.
Sorts ascending or descending, with the header row always kept in place at the top.
Uses locale-aware text comparison, so accented letters sort into a sensible position rather than always after plain ASCII ones.
Rebuilds the sort-by column list from your actual header row whenever the pasted data changes.
How to use it
- Paste your CSV data.
- Choose the column to sort by, and whether to sort it as text or as a number.
- Choose ascending or descending, then copy or download the result.
Why use this tool
Sorting a file by a column makes it easier to scan, group and check. Numeric sort avoids the "10 before 2" problem of text sort.
Why we built it
We built the CSV sorter to offer real numeric sorting as well as text sorting, so 2, 9, 10 sort in that order. Clean up first with the CSV formatter and remove repeats with the CSV duplicate remover.
Who this tool is for
- Analysts ordering exports
- Admin staff sorting lists
- Developers preparing data
When to use it
- Ordering a list by name, date or amount.
- Finding the largest or smallest values.
- Preparing data for review.
- Grouping similar rows.
Why text and number sorting give different results
Sorting numbers as text puts "10" before "9".
Text sorting compares values character by character, so "10" sorts before "9" because the character "1" comes before "9" - correct for names and codes, wrong for quantities, prices or years. Number sorting parses each cell as an actual number first, so 9 correctly sorts before 10. This tool separates the two explicitly rather than guessing which one you meant from the column's contents.
Why "sort by column" only works once the file is split the same way you'd expect
CSV has no single enforced format, so which text ends up in "column 2" depends on how the file was written in the first place.
RFC 4180 describes a common CSV convention - comma-separated fields, double quotes around a field that contains the delimiter, and a doubled quote to escape a literal one - but plenty of real-world exports vary: semicolon delimiters are common where a comma is used as a decimal separator, some tools use tabs, and quoting rules aren't always followed consistently. Sorting by a column only makes sense once the parser has correctly identified where one field ends and the next begins, which is why this tool uses a quote-aware parser rather than a plain split on commas - a value like "Doe, Jane" wrapped in quotes stays intact as one field instead of being torn into two and thrown off by one column.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | A CSV with a header row. |
| Options | Column, text or numeric, ascending or descending. |
| Output | The sorted CSV with the header in place. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Numbers sort oddly | Text sorting was used. | Choose numeric sorting. |
| Non-numeric cells go first | They are treated as zero. | Clean the column. |
| Second sort key needed | One column at a time. | Sort twice or use a spreadsheet. |
Assumptions and limitations
- Numeric sorting treats a non-numeric cell as 0, since there's no other sensible numeric value to assign it.
- Only one column can be sorted by at a time - there's no multi-column, tie-breaking sort.
Frequently asked questions
How do I sort a CSV file by column for free?
Paste your CSV, choose the column and sort type, and the rows re-sort instantly.
Why does my numeric column sort wrong?
Switch "Sort as" to Number - Text sorting compares digits character by character, which puts "10" before "9".
Does the header row get sorted too?
No - it always stays in place at the top when "First row is column headers" is checked.
Does this handle quoted CSV fields with commas inside them?
Yes - it uses a real RFC-4180-aware CSV parser.
Is my data uploaded anywhere?
No. Everything happens in your browser.
Can I sort by more than one column at once?
No - one column can be sorted at a time, with no secondary tie-breaking column.
Does it work with semicolon- or tab-delimited files?
Not directly - this tool splits on commas, so a semicolon- or tab-delimited export needs its delimiters converted to commas first, or the whole row will be treated as a single column.