Text Sorter & Deduplicator
Sort lines alphabetically or numerically and remove duplicates.
This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.
Reorders a list one line at a time — alphabetically, by the number each line starts with, or into a random shuffle — and can reduce it to unique lines only — and can drop duplicate and blank lines in the same pass.
How to use it
- 1Paste your list into the text box, one item per line.
- 2Choose Alphabetical, Numeric or Shuffle, and Ascending or Descending — the direction dropdown is disabled for Shuffle.
- 3Tick Remove duplicate lines or Remove empty lines if you need them, then press Process; the label above the result reports how many lines came back.
Example
- Input
- 10 9 banana 2, with Numeric mode and Ascending selected
- Output
- 2 9 10 banana
Numeric mode reads each line with parseFloat, which is why 9 lands before 10 rather than after it, and why any line that does not begin with a number is pushed below the numbers and ordered alphabetically down there. Choosing Descending reverses the finished list, so those non-numeric lines move to the top.
What happens to your data
Nothing is computed until you press Process, and when you do it is an array sort over the lines already in the page. The Set that backs duplicate removal is built for that one press and discarded with it; nothing is written to localStorage, so a reload leaves both boxes blank.
Last updated August 2026
A list rarely arrives in order. Four hundred addresses pasted out of the body of an email sit in the order people replied; a product code list that grew over two years has half a dozen entries in it twice. What you want is the same lines, ordered, with the accidental repeats gone.
Decide one thing before you paste: whether your lines are text or numbers. Sorting text is a character-by-character comparison, so a column of quantities read as text comes back as 1, 10, 100, 2, 20 — every line starting with a 1 ahead of anything starting with a 2. That is the right answer to the question that was asked and the wrong answer to the one you meant. Numeric mode reads a number off the front of each line instead, and is the mode for amounts, ids and scores.
The second thing worth knowing is that this orders whole lines, not fields. Paste a single column and it behaves; paste comma-separated rows and each row is placed by whatever its first column says, with the header line sorted into the middle of the data. Names written as Firstname Surname alphabetise by first name, because that is where the line starts.
Nothing is destroyed on the way through: what you pasted stays in the top box and the ordered version appears in a second box below it.
How it works
Toolvore splits what you paste on newline characters and works on the resulting array of strings. Nothing is trimmed, so a line with a trailing space is not the same line as its twin without one. The optional passes run in a fixed order before sorting: blank lines first, a line of nothing but spaces counting as blank, then duplicates, keeping the first occurrence and dropping the rest. Alphabetical mode compares the strings directly, which is code-unit order rather than dictionary order — digits ahead of capitals, capitals ahead of lower case when you untick Case-insensitive, and any accented or non-Latin character after every plain ASCII letter. That is where it is weakest: with no locale-aware collation, a list of European or Indian names will not come back in the order a reader of that language would put it. Descending reverses the finished list rather than inverting the comparison, so lines the sort treated as equal come back in the opposite order to the one they arrived in.
Common use cases
- Alphabetising names pasted out of an email thread
- Putting a column of invoice numbers into ascending order
- Stripping repeated addresses from a mailing list before an import
- Removing blank lines left by a copy out of a PDF
- Randomising entrants to set a running order
- Tidying two dependency lists for a line-by-line comparison
Frequently asked questions
Why does my list of numbers sort as 1, 10, 100, 2?+
Because that is what alphabetical order does to digits. A text comparison reads left to right and stops at the first character that differs, so every line beginning with 1 lands ahead of every line beginning with 2 whatever its length. Numeric mode fixes it by reading a number off the front of each line before comparing. Be aware of what that reader accepts: 12 boxes is read as 12, but 1,000 stops at the comma and reads as 1, a version string like 1.10.2 reads as 1.1, and 5 behind a currency symbol is not a number at all.
How do I alphabetise a list of names by surname?+
Rearrange the names first, then sort. A line sort reads from the first character on the line, so Firstname Surname orders by first name and nothing looks past it. The usual fix is to get the list into Surname, Firstname form before it arrives — a spreadsheet can split a full name into two columns and join them back the other way round, and a find-and-replace with a pattern will do it for a list that is reliably two words. Watch the awkward ones: two-word surnames, particles such as van or de, and single-word names a split will mangle.
What counts as a duplicate when you remove duplicate lines?+
An exact match of the whole line, which is stricter than it sounds. A trailing space, a stray tab or a different apostrophe makes two lines that look identical count as two — the usual reason a de-duplicate pass leaves what looks like the same entry twice. Case is the exception you control: with Case-insensitive ticked, Apple and apple are one line and the first one seen is kept; untick it and both survive. Blank line removal runs first, so if you leave that box unticked, several blank lines count as duplicates of each other and collapse to one.
Why do names with accents end up at the bottom of the list?+
Because the comparison is on character codes, and every accented Latin letter sits above plain z in that numbering — so José, Ångström and Émile fall after Zoe rather than beside Jones, Anderson and Emile. Greek, Cyrillic and Indic scripts sit further out again and gather at the end as a block. There is no locale setting here to change that, and no single correct answer either: å is a separate letter after z in Swedish and an accented a in German, so a mixed list must be sorted for one audience or the other.
Does uppercase sort before lowercase?+
It depends on the Case-insensitive box, which is ticked when the page loads. Left ticked, case is ignored for ordering, so Apple, banana and Cherry come back in the order a person would expect. Untick it and the comparison uses raw characters, where every capital comes before every lower-case letter — Zebra ahead of apple, and inconsistent capitalisation splitting into two alphabetical runs. That box also decides whether Apple and apple count as one line when removing duplicates, so untick it only when the difference genuinely matters, as with case-sensitive identifiers or file paths.
Is anything I paste uploaded or stored?+
No. Pressing Process runs an ordinary array sort over the text already sitting in the page, so your list never becomes part of a request, and there is no file picker to upload one from. Nothing is written to browser storage either: reload the page and both boxes are empty, with no history of what you sorted last time. The copy button is the only thing that moves any of it anywhere, and that only onto your own clipboard. Worth knowing when the list is customer emails or staff names, which is a lot of what people sort.
How do I sort a column from a spreadsheet or a CSV file?+
Copy the one column you care about and paste it in — one cell per line is exactly the shape this expects. A full CSV is a different matter. Rows are ordered by whatever their first field says, the header row is sorted in with the data rather than pinned to the top, and no field parsing happens, so a comma inside a quoted value is not treated as anything special. Anything needing a second sort key, or a sort on the third column, belongs in the spreadsheet that produced the file.
How do I randomise a list fairly, for a draw or a running order?+
Choose Shuffle. It walks the list from the end, swapping each line with one picked at random from the positions at or before it — the standard shuffle, which gives every arrangement the same chance. The direction dropdown is disabled while Shuffle is selected, because ascending and descending mean nothing there, and each press of Process gives a different result. Two limits: the randomness comes from the browser's general-purpose generator rather than a cryptographic one, and there is no seed, so a shuffle cannot be reproduced or shown afterwards to have been fair.
Used in these workflows
Related tools
Markdown Previewer
Write Markdown and preview the rendered HTML live.
Find & Replace
Find and replace text with optional regex and case sensitivity.
Whitespace Cleaner
Remove line breaks, extra spaces, and tabs from text.
Word Frequency Counter
See which words appear most often in your text.