↕️

CSV Column Sorter

Sort your CSV rows by any column, ascending or descending. Automatically detects numeric vs text values for correct sort order.

📂 Drop a CSV file here or
Input CSV
Sorted Output

About CSV Column Sorter

The CSV Column Sorter reorders all data rows in your CSV by the values in a chosen column. It automatically detects whether the column contains numbers or text and uses the appropriate comparison - numeric sort for number columns, and locale-aware alphabetical sort for text columns.

How to Use

  1. Upload a CSV file or paste CSV text.
  2. Select the Column to sort by.
  3. Choose Ascending or Descending order.
  4. Toggle Numeric Sort if the column contains numbers.
  5. Click Sort and download or copy the sorted CSV.

How It Works

The CSV is parsed, the header row is preserved, and the data rows are sorted using JavaScript's Array.sort() based on the selected column values. Numeric sort converts values to numbers before comparing.

Example

Sort a product list by Price (numeric, ascending) to see cheapest items first. Sort by Name (text, ascending) to produce an alphabetical product directory.

FAQ

The tool checks if all non-empty values in the sort column are valid numbers. If they are, it sorts numerically (so 10 comes after 9, not between 1 and 2). Otherwise it sorts alphabetically.
No. The header row always stays at the top. Only the data rows are sorted.
Currently the tool supports sorting by a single column. For multi-column sorting, sort by your secondary column first, then sort by the primary column - the stable sort will preserve the secondary order.
No. All sorting happens in your browser using JavaScript. Your data never leaves your device.