CSV Sorter
Sort CSV rows by one or two columns online — as text, numbers or dates, ascending or descending, with the header row kept pinned. Free and fully in-browser.
What is the CSV Sorter?
The ByteTools CSV Sorter reorders the rows of a CSV file by any column you choose. Pick a primary sort column and an optional secondary tie-breaker, set each one to ascending or descending, and tell the tool whether to compare values as text, numbers or dates.
- Sort by one or two columns with per-column direction
- Text (natural), numeric and date comparators
- Header row detected and kept in place
- Quote-aware parsing keeps multi-line fields intact
- Copy or download the sorted CSV
- 100% private — runs entirely in your browser
How to use the CSV Sorter
- 1
Paste your CSV or drop a .csv file.
- 2
Tick whether the first row is a header — it stays pinned while the data sorts.
- 3
Choose the sort column, comparison type (text, number or date) and direction.
- 4
Optionally add a second column as a tie-breaker.
- 5
Click Sort CSV, then copy or download the result.
About the CSV Sorter
The ByteTools CSV Sorter reorders the rows of a CSV file by any column you choose. Pick a primary sort column and an optional secondary tie-breaker, set each one to ascending or descending, and tell the tool whether to compare values as text, numbers or dates.
Text sorting uses natural ordering, so item2 comes before item10. Number sorting reads 1,200 and 85.5 as real values instead of strings, and date sorting understands common formats like 2024-03-01. The header row stays pinned to the top and is never mixed into the data.
Sorting happens 100% locally in your browser — the file is never uploaded anywhere. Drop in exports from Excel, a CRM or a database, sort them, and download the result in seconds.
Frequently asked questions
How do I sort a CSV file by a specific column?
Paste the CSV, pick the column in the Sort by dropdown — the tool reads your header names automatically — choose ascending or descending, and click Sort CSV. The rows are reordered while the header row stays at the top.
Why do my numbers sort wrong, like 10 before 2?
That happens when numbers are compared as text, character by character. Switch the comparison type to Number and the tool parses each cell as a numeric value, so 2 correctly sorts before 10 and thousands separators are ignored.
Can I sort by two columns at once?
Yes. Set a primary column and then a Then by column. Rows are ordered by the first column, and any rows with equal values there are ordered by the second — for example department A to Z, then salary high to low.
How are dates sorted?
Choose Date as the comparison type and each cell is parsed with the browser's date parser, which handles ISO formats like 2024-03-01 and most common variants. Cells that cannot be parsed as dates are sorted after the valid ones.
Does sorting break quoted fields that contain commas or line breaks?
No. The parser understands CSV quoting, so a field like "Smith, John" or a multi-line address travels with its row as one unit and is re-quoted correctly in the output.
Related tools
CSV Filter
Filter CSV rows online by column conditions — equals, contains, regex, empty, numeric ranges — combined with AND/OR. Keep or remove matches, fully in-browser.
CSV Cleaner & Deduplicator
Clean CSV online: remove duplicate rows, trim whitespace, drop empty rows and normalise the delimiter. See before/after counts — 100% in your browser.
CSV Viewer & Table
View CSV as a clean HTML table online. Live search filter, row and column counts, delimiter and header options — all processed locally in your browser.
Sort Lines
Sort lines of text alphabetically A to Z or Z to A, by length, numerically, or shuffle randomly. Options to ignore case and remove duplicates.
CSV to JSON Converter
Convert CSV to a JSON array of objects online. Header-row detection, comma/semicolon/tab delimiters and pretty-printed output — 100% in your browser.