Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. CSV & Data Analysis
  3. CSV Sorter
Add to favorites

CSV Sorter

Sort a CSV by one or more columns, with numbers sorted by value, dates by day and item2 before item10, then download the sorted file.

Rows never leave your deviceMore csv & data analysisJump to full guide

Initializing in your browser…

You might also like

CSV Column Filter

Choose which columns of a CSV to keep and in what order, preview the result, and download a smaller file with every value carried over unchanged.

CSV Data Type Detector

Find out what kind of data each CSV column holds, from numbers and dates to emails, URLs and codes with leading zeros, and get a CREATE TABLE statement for your database.

CSV Column Renamer

Rename CSV column headers one by one or all at once, in snake_case, camelCase or another style, with abbreviations expanded and duplicate names caught.

A sample run

A product list needs ranking by price, highest first. The prices include a grouped thousand, an accounting negative for a refund and an N/A, and the SKU column holds codes like item2 and item10.

Price and SKU columns, in file order

Product     SKU      Price
Laptop      item2    999
Mouse       item10   29
Keyboard    item1    "1,299"
Monitor     item20   299
Headphones  item3    N/A
Webcam      item100  89
Speaker     item21   (199)
Microphone  item22   129
What CSV Sorter produces

Sorted by Price, descending (automatic)

Keyboard 1,299 | Laptop 999 | Monitor 299 | Microphone 129
Webcam 89 | Mouse 29 | Speaker (199) | Headphones N/A

Sorted as numbers: 7 of 8 values are numbers; those sort by
value and the rest sort after them.

SKU, ascending (automatic, natural order):
item1  item2  item3  item10  item20  item21  item22  item100

The price column is detected as numeric, so "1,299" is read as 1299 and lands first, and (199), the accounting way of writing minus 199, lands below every positive price. N/A cannot be read as a number, so it goes last instead of being treated as zero. Sorting the SKU column the same way picks natural order because every value mixes letters and digits; compared as plain text the same codes would come out item1, item10, item100, item2.

Sort CSV Rows the Way You Expect

Sort the rows of a CSV file by any column, then break ties with a second or third column. The tool looks at each column and sorts numbers by value, dates by the calendar and codes like item2 and item10 in natural order, so 1,299 comes after 999 and 10 comes after 9. Download the result as a new CSV in the file's own delimiter.

How to use

  1. 1Drop a CSV file on the page, choose one, paste rows, or press Try a sample, which opens already sorted by price.
  2. 2Pick the column to sort by, or tap its heading in the preview table.
  3. 3Choose Ascending or Descending, and change Compare as if the automatic choice is not what you want.
  4. 4Press Add a tiebreak column to sort by a second or third column within equal values.
  5. 5Open More options to put blank cells first, sort text by a language's alphabet, or turn off the header row.
  6. 6Check the preview, then press Download sorted CSV.

Key features

  • Automatic choice of number, date, natural or text order for each column, with the reason shown
  • Numbers read with thousands separators, currency signs, percentages and accounting negatives
  • Dates in ISO, day-first or month-first form, with the order detected from the column, and time zone offsets respected
  • Natural order for codes and file names, exact even for 20-digit numbers
  • Any number of tiebreak columns, each with its own direction and comparison, and a stable result
  • Blank and unreadable cells kept together at the end or the start
  • Text by Unicode code point or by the alphabet of eleven languages, optionally ignoring case and accents
  • One-tap sorting from the preview table headings
  • An automatic check that every row is in order
  • Download keeps the file's delimiter, with CRLF line endings and a UTF-8 byte order mark

How it works

Why plain sorting goes wrong. Every value in a CSV file is text, and sorting text character by character gives answers that look broken: 10 before 9, 1,299 before 200, and 31/12/2023 after 01/05/2024. Spreadsheets hide this by guessing types when they open a file, and they do not always guess right. This sorter decides per column and tells you what it decided, for example "7 of 8 values are numbers; those sort by value and the rest sort after them".

Six ways to compare. Automatic is the default and chooses for you. Number reads values the way a spreadsheet displays them, including thousands separators, currency signs, percentages and accounting negatives such as (199). Date understands ISO dates, date-times with time zone offsets (10:00+02:00 is compared as 08:00 UTC) and day/month/year or month/day/year, and works out which of the last two a column uses from a value that can only be read one way, such as 25/03/2024 (when no value settles it, day first is assumed and stated). Natural treats runs of digits as numbers, so file2 comes before file10 and long order numbers compare digit by digit without rounding. Text compares by Unicode code point, or by the alphabet of a language you pick, and Length sorts by the number of characters.

Several columns. Add tiebreak columns to sort by country, then city, then date. Each rule has its own direction and comparison, and the rules can be reordered. Rows that tie on every rule keep the order they had in the file, so sorting is stable and predictable. Tapping a column heading in the preview is a shortcut for a one-column sort: once for ascending, twice for descending, three times to go back to the original order.

Blanks and unreadable values. Empty cells and values that cannot be read the chosen way, such as N/A in a price column, are kept together at the end, or at the start if you prefer, whichever direction you sort in. This matches NULLS LAST in SQL and stops a handful of blanks from hiding your smallest or largest values.

Checked output. After sorting, the tool walks through the result and confirms every row is in order before you download. The preview shows each row's original position, and the file is written with the delimiter it came in (a semicolon file stays semicolon separated), CRLF line endings and a UTF-8 byte order mark so Excel opens it with accents intact. Everything happens in your browser.

Where this fits a data pipeline

  • Ranking products or sales

    Sort an export by revenue, highest first, to see the top sellers, even when amounts are written as $1,299.00.

  • Putting events in date order

    Order a log or a booking list by date and time, including timestamps from different time zones.

  • Grouping a list for printing

    Sort by department, then surname, then first name, so each department's people appear together in alphabetical order.

  • Tidying codes and file names

    Order SKUs, invoice numbers or image names naturally so INV-9 sits before INV-10 instead of after INV-1.

Tips & best practices

  • Read the line under each rule. It says how the column was compared and how many values were blank or could not be read.
  • For names, sort by surname and then add a tiebreak on first name.
  • If a numeric column refuses to sort by value, look for stray text such as TBC or a footnote mark in one of the cells.
  • The Row column in the preview shows where each row was in the original file, which helps when checking a sort.

Examples

  • Prices with formatting

    Sorting 999, 29, "1,299", (199) and N/A from highest to lowest gives 1,299, 999, 29, (199), and N/A last, because (199) is read as minus 199 and N/A is not a number.

  • SKUs in natural order

    item1, item2, item3, item10, item20, item100. Sorted as text the same codes come out as item1, item10, item100, item2.

  • Mixed date formats

    A column holding 05/03/2024 and 25/03/2024 is read as day first, because 25 cannot be a month, so 5 March sorts before 25 March.

Frequently asked questions

Why did 10 sort before 9 in another program?

Because the values were compared as text, character by character, and "1" comes before "9". Here a column of numbers is detected and sorted by value. If a column is detected the wrong way, set Compare as on that rule.

How does it tell day/month dates from month/day dates?

It looks for a value in the column that can only be read one way, such as 25/03/2024, and uses that order for the whole column. The explanation under the rule names the value it used. If every date could be read either way, the dates are read day first and the explanation says so.

Where do empty cells go?

To the end by default, whether you sort ascending or descending, together with any values that cannot be read the chosen way. Under More options you can put them first instead.

Can I sort by more than one column?

Yes. Press Add a tiebreak column for as many levels as you need. The first rule decides the order, and each rule below only breaks ties left by the ones above. Rows that are equal on every rule keep their original order.

Why are capital letters sorted before lower case?

Text is compared by Unicode code point by default, where A to Z come before a to z. This gives the same result on every computer. For a dictionary order, choose A language under More options and pick yours; you can also make case and accents count or not.

Does the sorted file keep my semicolons and special characters?

Yes. The download uses the same delimiter as the file you loaded, quotes fields only where needed, and starts with a UTF-8 byte order mark so Excel displays accented and non-Latin text correctly.

Is there a size limit?

Only your device's memory. Files of a few hundred thousand rows sort in a moment in a desktop browser. The preview shows the first 50 rows and the download contains all of them.

Related tools and how they differ

  • CSV Viewer & Editor: Use it to look through or edit a file while sorting by one column at a time.
  • CSV Row Filter: Use it first when you only want some of the rows, for example one region, before sorting them.
  • CSV Duplicate Remover: Use it when sorting is a step towards finding repeated rows; it finds and removes them directly.

Private by design

Rows and columns are parsed and transformed in memory in your browser. No record ever reaches a server.