sort linesremove duplicate linesdeduplicate listline sorter

Sort Lines and Remove Duplicates From a List Online

How to sort, remove duplicates, reverse or shuffle lines of text in your browser, and what counts as an exact duplicate line.

August 22, 2026·4 min read

To sort a list of lines or remove duplicates, paste the text into the line sorter and duplicate remover. Each line is one item, and the result updates instantly in your browser. It helps with email lists merged from several sources, task lists or exported data, where checking hundreds of lines by eye isn't practical.

All these operations work line by line on a block of text.

The four basic operations on line lists

  • Sort: A to Z or Z to A. Numbers are compared by value, so item2 comes before item10. When sorting, case doesn't count first: if two lines differ only in case, the lowercase one comes first.
  • Remove duplicates: deletes repeated lines and keeps the first occurrence of each. The comparison is exact (see below).
  • Reverse: flips the final result, after sorting or shuffling.
  • Shuffle: reorders the lines at random, to mix up a list. For draws, see the use cases.
  • Remove empty lines: on by default. It removes lines with no text or with only spaces and tabs.

How to use the line tools

  1. Paste your list, one item per line.
  2. Choose the order: unsorted, A→Z, Z→A or shuffle. Only one order can be active at a time.
  3. Turn on the extra options you need. Remove duplicates and reverse combine with the order and with each other.
  4. Copy the result with the Copy button.

With this input, sorted A→Z and with duplicates removed:

item10
item2
Gato
gato
item2

the tool returns:

gato
Gato
item2
item10

gato and Gato stay as separate lines, and the second item2 is removed.

Why deduplicating by hand is more error-prone than it seems

Checking by eye fails on long lists. Two addresses like Ana@example.com and ana@example.com look almost the same, and it's easy to miss the repeat. The tool, by contrast, compares each line as exact text: those two are different lines, and so are gato and gato (with a trailing space). To treat them as equal, normalize the list first: convert it to lowercase with the case converter and remove stray spaces in your editor. Only do this if your data doesn't distinguish capitals.

In the terminal, uniq only removes repeated lines that sit next to each other, which is why it is usually run after sort. The GNU coreutils manual describes it that way.

Real use cases

  • Cleaning up contact or email lists merged from several sources, removing repeated entries before a campaign or a send.
  • Preparing data to import into another system, where duplicates can cause errors or repeated records.
  • Organizing task lists or ideas alphabetically so you can review them calmly.
  • Shuffling a list of participants. The Shuffle button reorders at random with Math.random, which is not a cryptographic generator. To pick a winner, use the random picker, which uses crypto.getRandomValues, the browser's cryptographic random generator.

Frequently asked questions

Does deduplication distinguish uppercase from lowercase? Yes. "Ana" and "ana" are different lines, and so are "cat" and "cat " with a trailing space.

What happens with empty lines? The Remove empty lines option is on by default, so lines with no text and lines with only spaces or tabs are deleted. Turn it off if you need to keep them.

Can I sort numerically instead of alphabetically? A→Z and Z→A already compare numbers by value, so 2 comes before 10. There is no separate mode. With decimals you don't get a numeric order: 1.10 comes after 1.5, because the tool compares digit blocks separately.

Is my list uploaded to any server? No. All processing happens in your browser with JavaScript.


Sort, deduplicate, reverse or shuffle any list for free with the line sorter, 100% in your browser.

Try it without code

Line Sorter and Duplicate Remover

Sort, deduplicate, reverse or shuffle lines.

Open Line Sorter and Duplicate Remover

Built by

Miguel Ángel Colorado Marin (MACM)

Full-Stack Developer · Guadalajara, España

I develop web apps, digital tools and full projects — from design to deployment.

Contact me