Line tools
Paste a list, one item per line, and sort it, remove duplicates, shuffle it, number it or join it into one line.
This free online line sorter and duplicate remover works in your browser. Everything runs in your browser. What you type is not sent anywhere. All inputs and calculations run locally on your device without server uploads; details on browser processing and storage are set out in the privacy policy.
What each button does
| Button | Result |
|---|---|
| Sort A → Z | Alphabetical, with numbers in natural order: “item 2” comes before “item 10”. |
| Sort by length | Shortest lines first. |
| Shuffle | A random order, using your browser’s secure random generator. Good for drawing names. |
| Remove duplicates | Keeps the first copy of each line, in the original order. |
| Keep only duplicates | Shows each line that appears more than once, once. |
| Number lines | Adds 1., 2., 3. at the start of each line. |
| Add to each line | Wraps every line, for example in quotes for a list of values. |
| Join into one line | Use “, ” for a comma list or \n for new lines. |
Handy recipes
- A SQL list: add
'before and',after each line. - A random winner: paste the names, press Shuffle, take the first line.
- Clean an email list: Trim spaces, Remove empty lines, then Remove duplicates with “Ignore case” on.
Worked example: Deduplicating, trimming, and sorting a 6-line email/tag list
Suppose you copy a messy list of tags or email addresses from three different spreadsheet columns:
staging-api
prod-db
staging-api
alpha-worker
prod-db
- Click Trim lines: Strips the leading and trailing spaces around
staging-apiandprod-dbso identical items actually match character for character. - Click Remove empty lines: Deletes the blank 3rd line, reducing 6 lines to 5.
- Click Remove duplicates: Keeps only the first occurrence of
staging-apiandprod-db, reducing 5 lines to 3 unique items. - Click Sort A → Z: Outputs the clean alphabetical list:
alpha-worker prod-db staging-api
Limits and what this tool cannot do
- Always run 'Trim lines' before 'Remove duplicates': Duplicate detection compares whole lines. If one line is
"apple"and another is"apple "(with a trailing space), they are different strings until you click Trim lines. - Case sensitivity in duplicate removal:
"Admin"and"admin"have different ASCII code points; convert case first in the Case Converter if you need case-insensitive deduplication. - Operates on whole lines (
\n), not CSV columns: It sorts entire lines from column 1; it cannot sort a multi-column CSV table by the 3rd column.
Questions
Does Remove duplicates change the order?
No. It keeps the first time each line appears and removes later copies.
How many lines can it handle?
Hundreds of thousands. Everything happens in your browser.
Is the shuffle really random?
Yes. It uses the Fisher–Yates method with the browser’s cryptographic random numbers, so every order is equally likely.
Can I sort numbers?
Yes. Sort A → Z puts numbers in numeric order, so 9 comes before 10.
What is the difference between Alphabetical sort and Natural number sort?
Standard alphabetical (ASCII) sort compares character by character from left to right, putting item10 *before* item2 because '1' comes before '2'. Natural sort parses embedded numbers as integers so item2 comes before item10.
How is the Shuffle lines button randomized?
It uses the Fisher-Yates shuffle algorithm driven by crypto.getRandomValues() so every permutation of your list is equally likely.
Can I turn a multi-line list into a comma-separated list on one line?
Yes. Use the Join lines action (or paste into Remove Line Breaks with a comma separator) to collapse lines into item1, item2, item3.
Related converters and guides
- Find and replaceReplace words or patterns throughout a text, with regex support.
- Text cleanerStrip extra spaces, HTML, emoji and invisible characters.
- Email and link extractorPull emails, URLs, phone numbers or hashtags out of any text.
- Text compareSee exactly what changed between two versions of a text.