Sort & Dedupe Lines
A grab bag for the things you'd do with `sort | uniq | grep -v '^$'` in a shell — alphabetical, descending, or natural sort (so 'item10' comes after 'item2', not after 'item1'); deduplicate (case-sensitive or not); trim whitespace; drop blank lines; reverse the result; or shuffle for a randomized order. Counts shown for input, output, and removed lines so you can see what changed.
Paste lines on the left.
Operations apply in order: trim → remove blank → dedupe → sort → reverse. All processing happens in your browser.
How to use
- Paste your list on the left.
- Pick a sort order and toggle the options you want (dedupe, trim, etc).
- Copy the output from the right panel.
Frequently asked questions
- What's 'natural sort'?
- Sort that understands embedded numbers: 'item2', 'item10' instead of 'item10', 'item2'. Uses Intl.Collator with numeric=true under the hood. Useful for filenames, version numbers, sequential IDs.
- Is shuffle deterministic?
- No — it uses Math.random() with the standard Fisher-Yates algorithm. Click 'shuffle' again to get a different order. If you need a seeded shuffle (for reproducible randomness), this isn't the tool.
- Does dedupe preserve order?
- If sort is 'none', yes — the first occurrence wins and the rest are dropped. If sort is set, dedupe happens before sort, so the output is the sorted set of unique lines.
- What if I want to keep blank lines as separators?
- Uncheck 'remove blank lines'. Blank lines are kept but they're not deduped — every blank line is unique in this tool's view (after trim, they're all empty strings, but the dedupe runs after the trim. So actually they will dedupe.) Real answer: yes, blank lines after trim are equal, so they'll be deduped to one. If you need them preserved, turn off both 'remove blank' and 'trim'.
Related tools
Reverse Text
Reverse text four ways — by characters, word order, the letters inside each word, or line order. Works with emoji and any language.
CSV Viewer & Sorter
View CSV / TSV data as a sortable, searchable table — open a file or paste rows, no spreadsheet required.
Remove Line Breaks
Join wrapped lines back into clean, flowing text — strip the hard line breaks you get when copying from PDFs or emails, while keeping real paragraphs.
Line Formatter — Add Prefix, Suffix & Join
Wrap each line with a prefix and suffix and join them with any separator, in your browser.
Character & Word Counter
Count characters, words, sentences, lines, and bytes in real time.
Case Converter
Convert text between UPPER, lower, Title, camelCase, snake_case and more.