Remove Duplicate Lines and Sort Lines Online
Paste a list to remove repeated lines, trim spaces, delete empty lines and sort A to Z, Z to A, by number, by length or at random. Runs in your browser.
Paste your list, one item per line. Duplicate lines are removed and the first copy is kept. You can also trim spaces, drop empty lines and sort the result.
What it does
- Removes repeated lines and tells you how many it removed.
- Keeps the first or the last copy of each line.
- Can ignore case and trim spaces so near-duplicates match.
- Sorts A to Z, Z to A, naturally (file2 before file10), by length, in reverse or at random.
- Works with Windows and Unix line endings.
Example
Before
pear
apple
banana
apple
Pear
file10
file2
bananaAfter
apple
banana
file2
file10
pear
PearFrequently asked questions
- Is the order kept?
- Yes. Without sorting, the lines stay in their original order and only repeats are removed.
- What is natural sort?
- It reads numbers inside the text as numbers, so file2 comes before file10. A plain A to Z sort puts file10 first.
- Does it handle big lists?
- Yes. Lists with hundreds of thousands of lines usually work, depending on your device.
- Is my text uploaded?
- No. Everything runs in your browser.
More tools
Code formatters
CSS beautifier CSS minifier HTML beautifier HTML minifier JavaScript beautifier JavaScript minifier JSON formatter YAML formatter XML formatter SQL formatter Markdown preview
Converters
Base64 encoder and decoder URL encoder and decoder Unix timestamp converter CSV to JSON JSON to CSV HTML entity encoder and decoder Number base converter Time zone converter JSON to TypeScript XML to JSON HTML to Markdown Date difference calculator
Text tools
Regex tester Lorem ipsum generator Word counter Case converter Text diff checker
Color and images
Color converter Contrast checker Image to Base64 Image resizer
Network
Subnet calculator Download time calculator Common ports list CIDR to IP range IPv6 address expander and compressor MAC address formatter curl command builder
Server and files
Cron expression explainer chmod calculator HTTP status codes
Encoding and security
Password generator UUID generator Hash generator JWT decoder QR code generator Password strength checker Wi-Fi QR code generator