Công Cụ Nhanh

Sort lines alphabetically and remove duplicates online

Filter and format

Processed in your browser. Your files and data are never uploaded to a server.

Quick answer

Paste a list with one item per line and choose how to sort it: A → Z (with proper Vietnamese letter order), Z → A, by number, by length, reversed or randomly shuffled. Optionally remove duplicates, empty lines and extra spaces, number the lines, or add text to the start and end of each line. The result and the before / after line counts update instantly.

When to sort lines

Sorting a class list, removing duplicate emails before a mailout, ordering a price list from high to low, shuffling quiz questions: in a spreadsheet each of these means copying back and forth, and plain sorting puts “Line 10” before “Line 2”. This tool compares numbers by value and handles accented letters properly, all in your browser.

Illustration of paper strips rearranged into a staircase from short to long, with duplicate strips dropping into a bin

How to use it

  1. 1

    Paste the list on the left, one item per line (copying a spreadsheet column gives exactly that).

  2. 2

    Pick a sort order. For “Shuffle randomly”, press “Shuffle again” for a new order.

  3. 3

    Turn on what you need: remove duplicates, remove empty lines, trim spaces, number lines, add a prefix or suffix.

  4. 4

    Check the before / after counts, then copy the result back into your spreadsheet or document.

Sort orders

OrderInputResult
A → Zbanana, Apple, cherryApple, banana, cherry
Numbers inside textLine 10, Line 2, Line 1Line 1, Line 2, Line 10
Numbers descendingTea 3.5, Coffee 12, WaterCoffee 12, Tea 3.5, Water
Shortest firstElderberry, Fig, BananaFig, Banana, Elderberry
Reverse1, 2, 33, 2, 1

Filter options

OptionWhat it does
Remove duplicate linesKeeps the first occurrence. By default “Apple” and “apple” count as duplicates.
Trim extra spacesRemoves leading and trailing spaces and collapses repeated spaces.
Remove empty linesDrops lines with no text.
Number, prefix, suffixAdds “1. ”, “- ” or a trailing comma after sorting.

Examples

A class list

Paste the names column and choose A → Z. To sort by surname, put the surname first in a separate column before pasting.

De-duplicating emails

Paste 500 addresses and turn on “Remove duplicate lines”; the summary tells you how many were dropped.

A price list, highest first

Choose “Numbers descending”; the first number in each line is read, including 1,200,000 and 3.5.

Shuffling quiz questions

Choose “Shuffle randomly”; every “Shuffle again” draws a new order from the browser's secure random generator.

Common mistakes

“Line 10” sorted before “Line 2”.
That is character-by-character sorting; this tool compares numbers by value.
Two identical-looking lines weren't merged.
Usually extra or invisible spaces; turn on “Trim extra spaces”.
Number sorting puts some lines at the end.
Lines without any number go last, in alphabetical order.
Blank separator lines disappeared.
Turn off “Remove empty lines” and pick “Keep order” if you only want to de-duplicate.

Alphabetical order, including Vietnamese

Sorting uses the browser's language-aware comparison (Intl.Collator) with Vietnamese rules, so Ă and  come after A and Đ comes after D, and accented letters sit next to their base letter. For English text this behaves like a normal case-insensitive A–Z sort.

Is the shuffle really random?

It uses the Fisher–Yates algorithm with numbers from the browser's crypto.getRandomValues, so every order is equally likely. Fine for small draws; use a public draw for anything with legal weight.

Glossary

De-duplicate
Remove lines identical to an earlier line, keeping the first.
Natural sort
Comparing numbers inside text by value, so 2 comes before 10.
Fisher–Yates
A shuffle in which every permutation is equally likely.

Frequently asked questions

Can I paste from Excel or Google Sheets?

Yes, a copied column becomes one line per cell.

Is there a line limit?

No fixed limit; a few hundred thousand lines work on an ordinary computer.

Does de-duplication ignore accents?

No: “Banh” and “Bánh” stay separate. Case is ignored if the “Ignore case” box is ticked.

How do I keep the original order and only remove duplicates?

Choose “Keep order” and turn on “Remove duplicate lines”.

Is my data uploaded?

No, everything runs in your browser.

Can I sort by the last word?

Not directly; move the word to the front (for example with Find and Replace and a regex) and sort again.

Ratings and comments

Loading…