← All tools

ORGANIZE / CSV → CSV

Sort CSV Rows

Sort whole rows by one column as text or numbers. Keep the header first, equal values in their original order, and empty values last.

Your browser is the workspace
CSV
UTF-8 · Up to 5 MB
CSV
Waiting for input

How to sort CSV rows

Paste or open CSV, choose a column, select Text or Number and a direction, then select Sort rows. Copy or download the result. Every cell moves with its row; the header remains first.

Input limits

Use UTF-8 CSV up to 5 MB per input with unique, non-empty headers and consistent field counts. Blank rows are skipped. Output uses commas; formula-like strings gain a leading apostrophe for spreadsheet safety.

Sort CSV rows example

Input CSV
id,name,score
001,Alex,10
002,Sam,2
003,Jamie,2
004,Taylor,
Sorted CSV: score, Number, Ascending
id,name,score
002,Sam,2
003,Jamie,2
001,Alex,10
004,Taylor,

Frequently asked questions

How are Text and Number sorting different?
Text compares the original strings in case-sensitive Unicode code-unit order, without locale-specific collation. It places 10 before 2. Number compares decimal values, so 2 comes before 10. Cell text and leading zeros are retained in the output.
Where do empty values and equal values go?
Empty and whitespace-only cells stay last in both directions, retaining their original text. Rows with equal sort values keep their original relative order, including descending sorts. All other columns remain attached to their rows.
Which values does Number mode accept?
Use finite decimal numbers such as -2, 3.5 or 1e3, with optional surrounding spaces. Text, currency symbols, thousands separators, NaN and Infinity cause an error identifying the CSV record. Number mode uses JavaScript number precision; use Text for exact long identifiers.