TFT

CSV Row Sorter

Sort your CSV by any column — or chain multiple sort rules together. Numeric, alphabetic, and date-aware sorting all handled correctly, so your rows come out in exactly the order you need.

CSV Row Sorter

Sort CSV rows by one or more columns (asc/desc), supports numeric, alphabetical, date-aware sorting

Drag and drop a CSV file here, or click to browse

or paste CSV data below

How to use CSV Row Sorter:

  • Upload a CSV file or paste CSV data
  • Add sort levels for primary, secondary, etc. sorting
  • Choose sort type: Text (alphabetical), Number, or Date
  • Toggle between ascending and descending order
  • Reorder sort levels using arrow buttons
  • Click "Sort Rows" to generate output

What This Tool Does

This tool sorts CSV rows based on column values. Select one or more columns to sort by, choose ascending or descending order for each, and pick the sort type (text, number, or date). Multi-level sorting lets you sort by primary, secondary, and tertiary columns.

Sort Options

Single column sort: Sort by one column in ascending (A-Z, 0-9) or descending (Z-A, 9-0) order.

Multi-level sort: Sort by primary column, then by secondary column for ties, then tertiary for remaining ties.

Sort types:

  • Text — Alphabetical sorting (case-insensitive)
  • Number — Numeric sorting (handles decimals and negatives)
  • Date — Date sorting (recognizes common date formats)

Reorder levels: Drag sort levels to change priority order.

Example: Single Column Sort

Input CSV (unsorted):

name,age,salary
Charlie,35,60000
Alice,30,75000
Bob,25,50000

Sort by name ascending (A-Z)

Output CSV:

name,age,salary
Alice,30,75000
Bob,25,50000
Charlie,35,60000

Example: Multi-Level Sort

Input CSV:

department,name,salary
Engineering,Charlie,60000
Engineering,Alice,75000
Marketing,Bob,50000
Marketing,Diana,55000

Sort by department (A-Z), then by salary (high to low)

Output CSV:

department,name,salary
Engineering,Alice,75000
Engineering,Charlie,60000
Marketing,Diana,55000
Marketing,Bob,50000

Example: Numeric Sort

Sort by salary descending (numeric)

Output CSV:

name,age,salary
Alice,30,75000
Charlie,35,60000
Bob,25,50000

Note: Numeric sort correctly orders 75000 > 60000 > 50000. Text sort would incorrectly order them as 50000 > 60000 > 75000 (comparing first digits).

When to Use This

Report preparation: Sort data by date, amount, or name for presentation-ready reports.

Ranking analysis: Sort by numeric columns to identify top/bottom performers.

Grouping: Sort by category column to group related rows together.

Chronological ordering: Sort by date columns to see events in timeline order.

Data review: Sort to quickly spot outliers, duplicates, or data quality issues.

Sort Type Selection

Use text sort for: Names, categories, IDs, any non-numeric data.

Use number sort for: Prices, quantities, scores, measurements, any numeric data.

Use date sort for: Dates in formats like YYYY-MM-DD, MM/DD/YYYY, DD-MM-YYYY.

Choosing the wrong sort type gives incorrect results. Numbers sorted as text compare character-by-character ("10" < "2" because "1" < "2").

Handling Empty Values

Empty cells in the sort column are handled consistently:

Ascending sort: Empty values appear first.

Descending sort: Empty values appear last.

Limitations

Large files: Works best with files under 50MB. Very large files may cause slow sorting.

Date recognition: Only common date formats are auto-detected. Unusual formats may sort as text.

Frequently Asked Questions

Can I sort by more than 3 columns?

This tool supports up to 3 sort levels. For more complex sorting, use a spreadsheet or scripting language.

Does sorting preserve the original row order for ties?

Yes. The sort is stable — rows with equal values maintain their relative order from the input.

Can I reverse the sort order?

Yes. Toggle between ascending and descending for each sort level independently.