πŸ”’ Runs in your browser β€” nothing is uploadedβœ“ Free, no signup

Sort Lines & Remove Duplicates

Paste a list to sort it A–Z, Z–A, naturally or by length β€” and remove duplicate lines, empty lines and stray spaces in one go.

0 characters

Result

When should you use the Sort Lines?

  • Alphabetizing a list of names, keywords or URLs
  • Removing duplicate emails or IDs from a list
  • Cleaning up lists copied from spreadsheets or logs

How to use the Sort Lines

  1. 1

    Paste a list

    One item per line.

  2. 2

    Choose the order

    A β†’ Z, Z β†’ A, natural (2 before 10), by length, reverse or shuffle.

  3. 3

    Clean it

    Remove duplicates, trim spaces and drop empty lines. Ignore case to treat Apple and apple as the same.

  4. 4

    Copy

    Copy the result or download it as a text file.

Examples

Sorted with duplicates removed

Before

banana
apple
cherry
apple

After

apple
banana
cherry

Common errors and how to fix them

item10 sorts before item2
Choose Natural order β€” it compares the numbers inside text by value.
Duplicates weren't removed
Lines may differ by spaces or capitals. Keep Trim spaces on and tick Ignore case.
Related tools:Β Remove Line Breaks Β· Word Counter Β· Text Diff

More from Text Tools

Free tools that run in your browser β€” no signup, nothing uploaded.

Sort Lines FAQ

Keep 'Remove duplicates' ticked. The first occurrence of each line is kept and the rest are removed. The number removed is shown under the result.

Sorting that understands numbers inside text, so file2 comes before file10. Plain alphabetical sorting would put file10 first.

By default capitals and lowercase are both considered. Tick 'Ignore case' to sort and dedupe without regard to case.

Yes β€” choose Shuffle for a random order. It uses a secure random generator.

Hundreds of thousands of lines work fine in a modern browser.

No. Everything runs in your browser, so your text never leaves your device.