On-device AI — professional-grade, fully private.

Documents

How to Sort a List Alphabetically Online (Lines, Names, Numbers and Duplicates)

Paste a list, pick A-Z, Z-A, natural or by length, and get it sorted at once. Handles accents, numbers, duplicates, blank lines and CSV columns.

Updated November 7, 20268 min read

To alphabetise a list, paste it into the text sorter with one item per line, leave the criterion on Alphabetical and the direction on Ascending, and the sorted list appears below as you type. Copy it or download it. That covers names, tags, titles and keywords. The details that go wrong are the ones this guide is about: numbers that sort as text, accented letters, capital letters, blank lines, repeated entries and lists that are really tables.

Sorting a list, step by step

1

Put one item on each line

Paste the list into the input box, or drop a text file (.txt, .csv, .tsv, .md or .log). If your items are separated by commas or semicolons instead of line breaks, change Items are separated by under Input and output.

2

Choose how to sort

Under Sort by, pick a criterion and a direction: Ascending is A to Z, Descending is Z to A. The presets at the top (A-Z, Natural, Sort + dedupe and others) set a sensible combination in one click.

3

Decide about blanks and duplicates

Blank lines can be removed, placed first or placed last. Duplicates can be kept, removed when exactly equal, or removed ignoring case. The tool reports how many lines it dropped.

4

Copy or download

The result updates as you type, unless you turn off Sort as I type and use the Sort button instead. Copy the sorted text, or download it as a file.

The sort modes and when to use each

Most people only need A to Z, but the tool offers ten criteria, and every one runs ascending or descending. Picking the right one is usually the difference between a list that looks sorted and one that is.

CriterionWhat it doesUse it for
AlphabeticalLetters in the order of the language you chooseNames, tags, titles, keywords
NaturalDigit runs are compared as numbers, so item2 comes before item10File names, version labels, anything ending in a number
Numeric valueReads each whole line as a numberPrices, scores, measurements
Character lengthShortest or longest line firstSpotting outliers, tidying headlines
Word countFewest or most words firstComparing sentence-like lines
Last word (surname)Orders by the final word on the line"Maria Lopez" listed under L without retyping
Month name / Weekday nameJanuary to December, or Sunday through SaturdaySchedules and rotas
Reverse current orderFlips the order the lines are already inNewest-first from oldest-first
ShuffleRandom order, repeatable with a seed numberDraws and random orders you can reproduce

Reverse is not a sort. It flips whatever order you already have, and it works on any list. If you only want to flip the text of each line or the whole block, the text reverser does that, and the reverse text guide explains the options.

Why 10 comes before 9 (numbers in a list)

Alphabetical order compares characters from the left, one at a time. The line "10" starts with the character 1, and 1 comes before 9, so 10 sorts ahead of 9. That is correct for text and wrong for numbers. The same thing happens with "file10" and "file2".

Your lines look like…UseResult
9, 10, 100, 25Numeric value9, 10, 25, 100
file2, file10, file1Naturalfile1, file2, file10
file2, file10, file1Alphabeticalfile1, file10, file2
12 kg, 3 kg, N/ANumeric valueReal numbers first; lines that are not numbers, such as "12 kg" or N/A, are grouped at the end instead of being guessed at

Numeric understands decimals and thousands separators, and it treats a figure in accounting parentheses as negative. Lines it cannot read as a number stay at the end in both directions, the way a spreadsheet keeps blanks last.

Capital letters, accents and other languages

Case is ignored by default, so "apple" and "Apple" sit next to each other rather than all capitals coming first. Turn on Case-sensitive if you want them ordered apart. Accents are not ignored: "cafe" and "café" are different lines and stay separate entries.

The alphabet itself depends on the language. Under Language rules you can choose your browser's language or pick English, Spanish, German, French, Portuguese or Indonesian. In Spanish, for example, ñ is its own letter placed after n, and the tool follows the rules of the language you pick rather than raw character codes. If a list will be shared, pick the language explicitly so everyone who runs it gets the same order.

Ignore leading articles sorts "The Hobbit" under H. It knows the articles of the six supported languages: a, an and the in English, el and la in Spanish, der and die in German, le and l' in French, o and a in Portuguese, and the particles si, sang and para in Indonesian. If a list mixes capitalisation styles and you would rather make it uniform first, see changing text case.

Removing duplicates and blank lines

Duplicate removal happens after the sort, and the first line of each group is the one that survives. Choose Remove exact duplicates when only identical lines count, or Remove ignoring case when "Text", "TEXT" and "text" should collapse into one. Blank lines are handled separately and never mix into the sorted body.

If you mainly want to clean up repeats and keep your original order, use the text deduplicator instead. It compares by lines, words, paragraphs or a delimiter of your choice, lets you keep the first or the last copy, and can show only the unique entries, only the repeated ones, or only what was removed. That last view is handy for checking what went missing.

Paste a list and sort it A-Z, naturally, by number, length or column, with optional duplicate removal. Free: one file up to 25 MB, every sort criterion included. Pro: up to 50 files at once as a ZIP. It all runs on your device, not our servers.

Sort a list

Sorting by a column, or sorting a CSV

A list is often two fields wide, such as a name and a score. In the sorter, set Column to the field number and pick a Column delimiter (Tab, Comma, Semicolon, Space, Pipe or Custom). Each line is ordered by that field while the whole line moves with it. Column 0 means the whole line. Lines that do not have that many fields are grouped at the end. Copying two columns out of a spreadsheet gives tab-separated lines, which is why Tab is the default.

A second criterion, added with Add a tie-breaker, decides the order inside groups the first one leaves equal. Sorting by column 2 as a number and then column 1 as text gives you groups by value with names in order inside each group. Free includes two levels.

Your dataBetter toolWhy
One item per lineText sorterFastest for lists, with ten criteria
Two or three plain fieldsText sorter with a columnFine if no field contains the delimiter
A real CSV with quoted fields or a header rowCSV sorterUnderstands quoting and keeps the header row on top
More than two sort conditionsCSV sorterSort keys, each with its own type and direction; Free allows three

A comma inside a quoted field would split a CSV row in the wrong place in the text sorter. The CSV sorter reads the quoting properly. In it you pick a column under Sort keys, leave the type on Auto or set it to Number, Text, Date or Length, choose a direction and press Sort. For opening the result without garbled characters, see opening a CSV in Excel correctly.

When the result looks wrong

  • Numbers are in the wrong order. You are on Alphabetical. Switch to Numeric value, or Natural if the numbers sit inside text.
  • A name sits at the top that does not belong there. Look for a leading space and turn on Trim each line.
  • Capitals and lowercase are separated. Case-sensitive is on. Turn it off to keep "apple" and "Apple" together.
  • The same word appears twice. One copy may have a trailing space, or a different case. Trim each line, and use Remove ignoring case.
  • The whole text is one line. Your items use commas or semicolons rather than line breaks. Set Items are separated by to match.
  • Windows line endings changed. They should not. A file that arrives with Windows line endings is written back with them, and you can force Unix (LF) or Windows (CRLF) under Line endings if you are moving text between systems on purpose.

Frequently asked questions

How do I sort a list alphabetically online?

Paste the list with one item per line into the text sorter, keep the criterion on Alphabetical and the direction on Ascending for A to Z, or choose Descending for Z to A. The sorted list updates as you type; copy it or download it.

How do I sort numbers so that 2 comes before 10?

Use Numeric value if each line is a number, or Natural if the numbers are part of text such as file2 and file10. Plain Alphabetical compares character by character, so 10 comes before 2.

Does the sorter handle accented letters and other languages?

Yes. Under Language rules you can pick English, Spanish, German, French, Portuguese or Indonesian, or follow your browser. Accented words are kept as separate entries from their plain forms, and the order follows the chosen language rather than raw character codes.

Can I sort and remove duplicates at the same time?

Yes. Set Duplicates to Remove exact duplicates, or Remove ignoring case. The first line of each group survives, and the tool shows how many duplicates and blank lines it removed. For repeats only, without sorting, use the text deduplicator.

How do I sort a CSV by one column?

For a table with a header row or quoted fields, use the CSV sorter: choose the column under Sort keys, pick a direction and press Sort. A detected header row stays on top. Free allows three sort keys and one file up to 25 MB.

Is there a size limit, and is my list uploaded?

Free sorts one file at a time up to 25 MB, with every sort criterion included. Pro sorts up to 50 files at once and returns them as one ZIP. Sorting runs on your device, not our servers, so the list is not uploaded.

Keep reading

More in Documents →