Loading...
Loading...
Sort all rows in a CSV file by any column in ascending or descending order. The header row stays at the top and all data rows are reordered according to the values in the selected column.
Paste your CSV and select the column to sort by from the dropdown. Choose ascending (A to Z, or smallest to largest) or descending (Z to A, or largest to smallest), then click Sort. The output CSV has the same columns and the same header row, with data rows reordered by the values in the chosen column.
The sorter detects whether a column contains numeric or text values. If all non-empty values in the column parse as numbers, the sort is numeric — so 10 sorts after 9, not between 1 and 2 as it would in alphabetical order. If any value is non-numeric, the whole column sorts alphabetically and case-insensitively.
Rows with empty values in the sort column are placed at the end of the output, after all rows that have a value, regardless of whether you choose ascending or descending order.
Sorting before importing into a database can improve insert performance for tables with clustered indexes, since rows that share index key values arrive together in the import stream. Sorting a customer list alphabetically by last name before generating a printed directory avoids an ORDER BY in the query or a sort step in the report generator.
For competition results or leaderboards, sorting by score descending produces a ranked list in one step. For a product catalog sorted by price ascending, a supplier sees the cheapest options first without needing a spreadsheet to reorder the rows.
Sorting a time-series export by date ascending before converting to JSON or SQL helps downstream code that assumes records arrive in chronological order.
Does sorting change the original data?
No. The tool produces a new sorted CSV in the output box. The input is unchanged. Copy the output to continue working with the sorted data.
Are blank cells sorted first or last?
Rows with blank values in the sort column are placed at the end of the output regardless of sort direction. This prevents empty cells from clustering at the top in ascending sorts.
Can I sort by multiple columns?
One column at a time. For a multi-column sort, sort by the least-significant column first, copy the output, paste it back as input, and sort by the next column. The stable sort order ensures ties in the second sort preserve the order from the first.