Paste a list and clean it in one pass: trim, drop the blanks, remove duplicates, put it in order, then copy the result. Your text is never overwritten, and nothing leaves your browser.
Saved in this browser only. Nothing is sent anywhere.
0 lines
What This Tool Does
Paste a list and clean it in one pass. Trim the stray spaces, drop the blank
lines, remove the duplicates, put what is left in order, number it, wrap each
line, or join the whole thing into a single comma-separated string.
Your text stays in the box on the left. The result appears below, with a header
saying how many lines went in, how many came out, and what was removed.
Tip:
Load the sample list to see it work: it has a stray leading space, a blank line,
a duplicate that differs only by case, and two items numbered 9 and 10 that a
plain alphabetical sort gets in the wrong order.
How to Use It
Type into the box, paste from anywhere, or load a .txt, .md, .docx or .pdf file.
Turn on the operations you want in the panel on the right. They run top to
bottom, and the result updates as you type.
Copy takes the whole result, and Download saves it as a .txt file.
The Order Is the Point
The operations run in a fixed order, and the panel lists them in that order
because it changes the answer.
Trimming before deduplicating decides whether a line with a stray leading space
counts as a duplicate of the same line without one — usually it should.
Numbering after ordering is what makes the numbers describe the finished list
rather than the order you happened to paste. Wrapping before numbering is what
puts the number outside the quotes, so a numbered SQL list reads correctly.
Why Vietnamese Sorting Is Different
Most line tools sort with a plain character-code comparison. In English that
looks almost right. In Vietnamese it falls apart: every accented word is pushed
after Z, so a list starting with An, Ăn and Đá comes back with An first and the
other two stranded at the bottom, after Zoo.
Even an English alphabet is not correct for Vietnamese. English collation treats
đ as a variant of d, so it files Đá before Dê. Vietnamese treats đ as its own
letter, following d, so Đá comes after. This tool asks which alphabet you mean
rather than guessing, and defaults to the one that matches the page you are
reading.
The Code unit option is there on purpose. When you need to match what a shell
sort or a git diff produced, an alphabet is exactly what you do not want.
Two Recipes
To build a SQL list: turn on Trim, Remove blank lines and Remove duplicates, set
Order to A to Z, put an apostrophe in Prefix and an apostrophe in Suffix, then
set Join to Comma and space.
To turn a column copied from a spreadsheet into a single line: leave everything
off except Join, and pick Comma and space.
Counting the words rather than tidying the lines? The
Word Counter reads the same text. Changing how it
is capitalized? That is the Case Converter.
Frequently asked questions
Is my text uploaded anywhere?
No. Every operation runs in JavaScript inside your own browser tab, and the page keeps working with your network disconnected once it has loaded. If you leave Autosave on, your list is stored in your browser's own local storage on your device — press Clear and it is gone.
Are my Windows line endings preserved?
Yes, for files you load. The tool detects whether the text uses CRLF or LF and rebuilds the result with the same one, so a list loaded from a Windows file downloads again with its carriage returns intact — most online line tools quietly convert everything to LF instead. Text you paste or type into the box is a different matter: every browser strips carriage returns out of a text box before any script can read them, so pasted text arrives as LF whatever its source. If the endings matter, use Load file rather than pasting.
When there are duplicates, which one is kept?
The first occurrence, in the order the lines arrived. If you sort as well, the sort happens after the duplicates are removed, so the survivor is the first one in your original list rather than the first one alphabetically.
In what order do the operations run?
Top to bottom, exactly as they are listed: trim whitespace, remove blank lines, remove duplicates, order, prefix and suffix, line numbers, join. The order matters. Trimming before deduplicating is what decides whether a line with a stray leading space counts as a duplicate, and numbering after ordering is what makes the numbers describe the final list.
What does the Code unit alphabet mean, and when should I use it?
It compares the raw character codes instead of following an alphabet. That is what a plain sort in a shell, in git, or in most programming languages does — so pick it when you need to match one of those exactly. It is not a good reading order: it puts every uppercase letter before every lowercase one, and every accented word after Z.
Why does the sort differ from Excel or from sort in my terminal?
Because they are answering different questions. A terminal sorts by character code by default, which is the Code unit option here. Excel sorts by your system locale. This tool asks you which alphabet you mean, and defaults to the one matching the page you are on. For Vietnamese that matters: đ is its own letter after d, so Đá comes after Dê — an English collation puts it before.
What happens with a very long list?
Past 2,000,000 characters the result stops updating as you type and waits for the Run button, because re-sorting a document that size on every keystroke is not something a browser should attempt. Everything below that runs live.