Remove Duplicate Lines & Sort Text
Clean up lists of text fast — remove duplicate lines, sort A→Z or Z→A, reverse, trim, and strip empty lines, all in your browser.
We use cookies and similar technologies to enhance your browsing experience, analyze site traffic, and personalize content and ads. By clicking "Accept", you consent to our use of cookies. Learn more in our Privacy Policy.
Clean up lists of text fast — remove duplicate lines, sort A→Z or Z→A, reverse, trim, and strip empty lines, all in your browser.
Remove Duplicate Lines & Sort Text is a small utility for cleaning up line-based text. Paste in a list, log dump, set of email addresses, or any block where each line is its own record, and it will strip out duplicate lines, sort A-Z or Z-A, reverse the order, trim leading and trailing whitespace, and drop empty lines. You pick which operations to apply and see the result immediately.
It's built for the everyday text wrangling that doesn't justify writing a script: deduping a keyword list, alphabetizing a config block, or normalizing pasted data before it goes somewhere else. Everything runs in your browser, so the text you paste never leaves your machine and there's no upload, account, or size limit beyond what your browser can hold in memory. That makes it safe to use on internal lists or anything you'd rather not send to a server.
The tool treats your input as a list of lines split on newlines, then applies the operations you've enabled:
Order matters. A line that's " apple" with a leading space won't be seen as a duplicate of "apple" unless you trim first. The tool applies trimming before deduplication so whitespace differences don't hide real duplicates. Enable only what you need and the rest of your text passes through untouched.
Say you've collected tags from a few spreadsheets and the paste looks like this:
react
vue
React
vue
angular
react
There are inconsistent spaces, a blank line, a casing difference, and two clear duplicates of vue and react. Turn on Trim, Remove empty lines, Remove duplicates, and Sort A-Z, and you get:
React
angular
react
vue
Note that React and react both survive because deduplication is case-sensitive. Sorting also placed React before angular because uppercase letters sort ahead of lowercase ones in character-code order. If you want a single canonical tag, lowercase the input first (or in your editor) before deduping.
This tool earns its keep on quick, throwaway cleanups:
Because it's client-side, it's fine to use on lists that contain internal data, customer addresses, or anything you wouldn't paste into a third-party server.
A few behaviors that trip people up:
Foo, foo, and FOO are three different lines. Normalize case beforehand if you want them merged.item10 sorts before item2 because it compares character by character. For human-friendly numeric ordering, zero-pad your numbers (item02, item10).Two lines are "the same" only if every character matches, and several invisible characters can break that match. The usual culprits are leading or trailing spaces, tab characters, and the difference between line-ending styles.
Windows tools often write lines ending in carriage-return plus line-feed (\r\n), while Unix tools use just line-feed (\n). If a stray \r rides along at the end of a line, that line won't equal its clean counterpart even though they print identically. This tool splits on common newline styles and trims surrounding whitespace before comparing, which neutralizes the most frequent reasons a "duplicate" slips through. If you ever see two seemingly identical lines that won't collapse, the cause is almost always a hidden character. Enabling Trim resolves the space-and-tab case; copying the text through a plain-text editor first can strip exotic invisibles like non-breaking spaces.
Yes. Apple and apple are treated as different lines and both are kept. Convert the text to a single case before deduping if you want them merged.
The first occurrence is kept and any later repeats are removed, so the relative order of the lines you keep is preserved.
Sorting is lexicographic (character by character), not numeric. '1' comes before '2', so item10 lands before item2. Zero-pad the numbers to fix the order.
Only if you enable a sort or reverse. With just dedupe, trim, and empty-line removal, the surviving lines stay in their original order.
There's no fixed cap. The practical limit is your browser's available memory, which comfortably handles lists of hundreds of thousands of lines.
No. Everything runs locally in your browser. The text you paste is never sent to a server, so it's safe for internal or private data.
They differ in a character you can't see, usually trailing whitespace, a tab, or a stray carriage return. Enable Trim, which strips surrounding whitespace before comparing.
Yes. Enable both and you'll get a deduplicated, sorted result in one step. Trimming is applied first so whitespace doesn't interfere.