Sort CSV rows
Sort whole CSV records by one header using text or exact decimal values.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Choose a column from the actual CSV headers, then sort complete records as English text or exact decimal numbers. The header stays first, ties keep their input order, and cell text is preserved.
How to use this tool
- Paste a headered table or choose one UTF-8 file, then select its input delimiter.
- Choose a header, text or decimal comparison, and ascending or descending order.
- Sort the rows, check the first five output rows, then copy or download the complete CSV.
Supported inputs and limits
Paste up to 1 MiB or use one UTF-8 CSV, TSV or TXT file up to 10 MiB; at most 200,000 cells and 1,000 columns.
A nonempty unique header row and equal row widths are required. Numeric mode requires every chosen-column value to be a decimal number.
One sort key only. Numeric mode accepts optional signs, decimal points and scientific notation; a nonzero value’s normalized exponent has at most 64 digits. Dates, thousands separators and blank numeric cells are not parsed.
Table headers, preview cells and displayed column or filter values show at most 240 Unicode characters, followed by an ellipsis when shortened. Metadata JSON previews show the first 20,000 Unicode characters when limited; use the complete metadata JSON copy button for the full document. CSV copy and download remain complete.
Worked example
Example input
name,score Zoe,10 Amy,2 Ben,2
Example options
{"column":"score","sort":"number","direction":"ascending"}Example output
name,score Amy,2 Ben,2 Zoe,10
When something does not work
Paste up to 1 MiB or use one UTF-8 CSV, TSV or TXT file up to 10 MiB; at most 200,000 cells and 1,000 columns. A nonempty unique header row and equal row widths are required. Numeric mode requires every chosen-column value to be a decimal number.
Frequently asked questions
Will the other cells move with the sorted value?
Yes. Each data row moves as a whole, the header stays first, and rows with equal sort values keep their original order. Cell text, including formulas and leading zeros, is preserved; output uses comma-delimited CSV with normalized quoting and record endings.
How are numbers compared?
Decimal values, including optional exponents, are compared without converting them to floating-point numbers. For nonzero values, the exponent is limited to 64 digits after its sign and leading zeros are removed. Empty or nondecimal cells cause a clear error. Use text mode for identifiers with leading zeros.
Can I sort by several columns or dates?
No. This tool sorts by one header. Text uses English collation, including differences in accents and letter case; numeric mode does not interpret dates or thousands separators.
Is my CSV uploaded?
No. Processing happens in your browser. Save the result before closing the tab.