Skip to main content

Find your next tool

Prepare, check, then export

Sort Lines Alphabetically & Remove Duplicates

Paste one item per line and the sorted list appears below: A → Z by the rules of your language, natural order (file2 before file10), by the first number on each line, by length, reversed or shuffled. Remove duplicate lines, keep only the lines that repeat, or download how often each line occurs as a CSV file.

Loading text workspace…

Benefits

  • Alphabetical order follows the selected language: Émile sorts with E, German puts ä next to a, and Swedish puts it after z.
  • Duplicates are matched the way a reader sees them: “café” typed with a separate accent mark, spaces at the end of a line or, with Ignore case on, different capitals still count as the same line.
  • Long lists stay fast: in our tests a 1.5 MB list of 60,000 e-mail addresses was reduced to 20,000 unique lines and sorted in about 0.15 seconds, in a background worker so the page keeps responding.

When this helps

  • Alphabetize a class list, a draft bibliography or a glossary before pasting it back into a document.
  • Clean a mailing or customer list: remove repeated e-mail addresses and see which ones appeared more than once.
  • Put file names, version numbers or chapter titles in natural order, or shuffle names for a fair speaking order.

How to use this tool

  1. Paste your list with one item per line, or import a TXT file.
  2. Choose the order and what to do with duplicate lines.
  3. Decide how lines are compared: ignore upper and lower case, ignore spaces at line ends, remove blank lines.
  4. Check the counts, then copy or download the result, or open Line counts for a CSV of the repeats.

How lines are compared and put in order

A computer left to itself sorts by character codes, which puts every capital before every lower-case letter and “Émile” after “Zoë”. This page sorts with the collation rules of the language you select, the rules your browser’s Intl.Collator applies. With English rules, the list Zoë, émile, Émile, adam, Zach comes out as adam, émile, Émile, Zach, Zoë. Languages disagree about some letters: German sorts “ära” before “zon”, Swedish after it, because ä is the 28th letter of the Swedish alphabet. Choose the language of the list, which is not always the language of the page.

Plain alphabetical order compares digits one at a time, so file10 comes before file2. Natural order reads digits as numbers and gives file1, file2, file10. By first number goes further and sorts by the value of the first number on each line, which suits price lists and scores: “Total 99” comes before “Total 1,250.50”. It reads 1,250.50, 1.250,50 and 1 250,50 as the same amount, and a single comma or dot followed by one or two digits as a decimal mark, so 3,5 is 3.5. “1,250” is read as one thousand two hundred and fifty, while “1.250” is read as 1.25. Lines without a number go to the end in their original order.

Removing duplicates keeps the first copy of each line in its original position, then applies the order you chose. Two lines are the same when they match after Unicode normalization, so “café” typed as one character or as e plus a combining accent counts once. With Ignore case on, “Apple” and “apple” are one line, compared with the letter rules of the selected language: in Turkish, İzmir and izmir match; in English they do not. With Ignore spaces at line ends on, “ apple ” and “apple” match as well. The result shows how many lines went in, how many came out and how many were removed, so you can check the numbers before you use the list.

Shuffle uses crypto.getRandomValues, your browser’s cryptographic random number generator, with the Fisher–Yates method and rejection sampling, so every possible order is equally likely. That is fair enough for a speaking order, a seating plan or the order of quiz questions. It is not a certified draw: the result is not recorded anywhere, so for a prize draw that other people must be able to verify, use a service that publishes its method and its results.

Formats, limits and privacy

  • Up to 2,000,000 characters (UTF-16 code units) and TXT files of up to 2 MiB. Lists of 50,000 characters or more are processed in a background worker.
  • Each line is one item. A spreadsheet cell that contains a line break, as in some CSV exports, becomes two items; sort that kind of data in the spreadsheet instead.
  • By first number reads only the first number on a line, and dates such as 11/03/2026 are not compared as dates. Write them as 2026-11-03 and A → Z sorts them correctly.
  • The Line counts table shows the 200 most frequent repeated lines; the CSV download lists every line with its count.

These tools process text locally. There is no draft autosave. Download important work before leaving; temporary file handoffs expire after 30 minutes.

Frequently asked questions

How do I sort a list alphabetically?

Paste the list with one item per line and keep A → Z selected. The sorted list appears under the options; copy it or download it as a TXT file. In Word, the Sort button on the Home tab does the same for paragraphs, and in Excel or Google Sheets the Data menu sorts a column.

How do I remove duplicate lines but keep the original order?

Choose Keep original order and Remove duplicates. The first copy of each line stays where it was and later copies are dropped. Switch on Ignore upper/lower case if “Apple” and “apple” should count as the same line.

Why does file10 come before file2?

Plain alphabetical order compares one character at a time, and the character 1 sorts before 2. Choose Natural order to compare numbers by their value, which gives file1, file2, file10.

How can I count how many times each line appears?

Open Line counts under the result. It lists every line that occurs more than once with its count, most frequent first, and Download counts (CSV) saves all lines with their counts for a spreadsheet. Cells that start with =, +, - or @ are saved with an apostrophe in front, so a spreadsheet does not run them as formulas.

Is the shuffle really random?

It uses your browser’s cryptographic random number generator and the Fisher–Yates shuffle, so every order has the same chance. Click Shuffle again for a new order. Nothing is stored, so keep a copy if you need to show the result later.

Is my list uploaded anywhere?

No. Sorting, removing duplicates and counting run in your browser, and the list is not sent to MAXScanner or stored. Analytics record only which option was used, never the lines.

Continue your document workflow

Use a Continue button inside the workspace to carry your text; these links open a fresh tool.