Skip to content

Sort CSV: Order the Rows by Any Column

Sort CSV is a free OpenAnyDoc tool. Drop a CSV or Excel file, sort it by one or more columns and download it in the new order.

Runs on your device: no upload, no sign-up, no ads How to check

Try a sample file:

You can also paste CSV text with Ctrl+V (⌘+V on a Mac).

  • CSV: View and edit. .csv, .tsv, .tab, .xlsx, .xls, .xlsm, .ods
Paste text instead

Pasted text stays in this tab and is never sent anywhere.

How it works: sort a CSV file

  1. Open your file

    Drop a CSV or Excel file, choose it, paste CSV into the paste box, or try one of the samples.

  2. Pick the column and direction

    Choose a column in the Sort panel and click its direction button to switch between ascending and descending. Add another column to sort within ties.

  3. Apply to file

    Press Apply to file to write the sorted order into the table. Undo restores the previous order.

  4. Download

    Save the result as CSV, or as Excel, Markdown, HTML or SQL.

Sort CSV: what it can't do

  • No fixed limit; it depends on your device's memory
  • Dates sort in date order only when written year first (2026-03-09); other date styles sort as text.
  • Apply to file reorders every row and clears filters and hidden columns.
  • Without Apply to file, a download of all rows keeps the original order.
  • Excel files: only the first sheet is opened.

Sort CSV: questions and answers

Is my file uploaded?
No, your file is not uploaded: your browser sorts the rows on your device; nothing is sent to a server.
How do I sort a CSV by two columns?
Pick the first column, then add a second one in the Sort panel. Rows are ordered by the first column, and rows with the same value there are ordered by the second.
Why is the downloaded file not sorted?
Sorting only changes the view. Press Apply to file in the Sort panel to write the order into the file, then download.
Are numbers sorted as numbers?
Yes, a column read as numbers sorts by value, so 9 comes before 10. If a number column is read as text, change its type in the column's profile.
How are dates sorted in a CSV?
Dates written year first, such as 2026-03-09, sort in date order. Dates in other styles, such as 09/03/2026, are compared as text and may not come out in date order.
Does the header row move when I sort a CSV?
No, the header row stays on top and only the data rows are reordered.

Why it's private: your files never leave your browser

Many online file tools upload your file, so a copy of it leaves your device. OpenAnyDoc works the other way round: your browser reads the file and draws it on your screen. Nothing is uploaded, there is no account, and the file is gone from memory when you close the tab, so there is nothing for us to store, see or lose.