Sort Lines & Remove Duplicates

Sort lines A–Z, naturally or by length, and remove duplicate or empty lines

0 lines

Your files are processed in your browser. They are never uploaded, and nothing is stored after you close the page. How we handle privacy

Sort
Lines before
0
Lines after
0
Empty removed
0

Runs entirely in your browser. Nothing you type or upload is sent to us or stored.

Results are for general guidance. Please check anything important before relying on it. Terms of use

How to Use

  1. Paste your list into Your lines, one item per line. It can be names, roll numbers, keywords, email addresses or anything else. You can also open a .txt or .csv file, or click Try a sample.
  2. Choose how to Sort: A → Z, Z → A, Natural (so 2 comes before 10), shortest or longest first, reverse order, shuffle, or keep the original order.
  3. Switch on Remove duplicate lines if you need to, and choose whether “Apple” and “apple” count as the same. You can also remove empty lines and trim extra spaces.
  4. The Result updates straight away. It shows the line count before and after, and how many duplicates or empty lines were removed.
  5. Click Copy result, save it as a .txt file, or click Use as input to apply another step to the cleaned list.

Sort a list and remove duplicates in seconds

Lists turn up everywhere: student names copied from a WhatsApp group, roll numbers from an Excel sheet, keywords for a blog, product codes, email addresses for a mailing list. This tool lets you sort lines and remove duplicates without opening a spreadsheet. It also clears out blank lines and stray spaces. It all runs in your browser, and the text you paste is never uploaded.

Sort options explained

OptionWhat it doesExample result
A → ZAlphabetical, ignoring capital lettersapple, Banana, cherry
Z → AReverse alphabeticalcherry, Banana, apple
Natural (1, 2, 10)Numbers inside lines compared by valueItem 2, Item 9, Item 10
Shortest / Longest firstBy number of charactersOm, Ravi, Ananya
Reverse orderLast line becomes first3, 2, 1
ShuffleRandom order (new order on every click)Varies

Why “natural” sorting matters

Ordinary alphabetical sorting compares text one character at a time, so “Roll 10” comes before “Roll 2” because the character “1” comes before “2”. That's rarely what you want for roll numbers, invoice numbers, chapter names or file names. Natural sorting reads the digits as a whole number, giving Roll 1, Roll 2 … Roll 9, Roll 10. A plain list of numbers such as 100, 20, 3 also comes out right, as 3, 20, 100.

How duplicates are removed

The tool processes your text in a fixed order:

1. Trim spaces (if switched on)
2. Remove empty lines (if switched on)
3. Remove duplicates (the first occurrence is kept)
4. Sort

Trimming happens first, so “Delhi” and “Delhi ” (with a trailing space) count as duplicates when trimming is on. With Ignore case switched on, “MUMBAI”, “Mumbai” and “mumbai” are treated as the same line and only the first spelling is kept. If you keep the original order and only remove duplicates, the remaining lines stay exactly where they first appeared.

Worked example

Say you paste these six lines from a class form: “Ravi”, “ananya”, “Ravi”, an empty line, “Om”, “Ananya”. With A → Z sorting, duplicates removed (ignoring case) and empty lines removed, the result is three lines: ananya, Om, Ravi. The counters show 6 lines before, 3 after, 2 duplicates removed and 1 empty line removed.

Tips

  • To de-duplicate a column from Excel or Google Sheets, copy the column, paste it here, then paste the result back. Each cell becomes one line.
  • Lists with tens of thousands of lines work fine, and the result updates as you change options.
  • A → Z sorting uses standard Unicode collation, so lines in Hindi and other Indian scripts are sorted too, and English lines come out in normal dictionary order.
  • When two lines differ only in capital letters, A → Z keeps a fixed order between them, so the result is the same every time.

Frequently Asked Questions

Paste the list, switch on “Remove duplicate lines” and copy the result. The first occurrence of each line is kept. Choose “Keep order” if you don’t want the list sorted at the same time.

Because alphabetical sorting compares one character at a time, and “1” comes before “2”. Choose the “Natural (1, 2, 10)” option to sort numbers inside lines by their value.

Only if you switch on “Ignore case” under the duplicate option. Otherwise lines must match exactly, including capital letters. Switch on trimming too if some lines have extra spaces at the end.

No. Sorting and de-duplication run in your browser, so the list never leaves your device. That makes it safe for private lists like phone numbers or email addresses.

Yes. Choose “Shuffle” to put the lines in a random order, and click it again for a new order. It's handy for picking a random order of presentations or a lucky-draw sequence.