How to use
- Paste your list into the input box, one item per line.
- Press the operation you need: sort A to Z or Z to A, natural sort, reverse, remove duplicates, remove empty lines or trim spaces. Tick Ignore case if upper and lower case should count as the same.
- Copy the result, or press Use result as input to apply another operation to it.
Examples
b a c
→ a b cSort A to Z.
item10 item2 item1
→ item1 item2 item10Natural sort puts the numbers in numeric order. Sort A to Z would give item1, item10, item2.
x y x z y
→ x y zRemove duplicates keeps the first occurrence of each line, in the original order.
How it works
The text is split into lines, the operation is applied, and the lines are joined again.
Sort A to Z and Z to A compare the lines by their character codes. Natural sort uses the browser’s locale-aware comparison with numeric ordering turned on. Remove duplicates keeps a line only the first time it appears. Remove empty lines drops lines that contain nothing or only spaces, and trim removes spaces and tabs from both ends of every line.
The summary under the buttons shows how many lines there were before and after.
Sources
Frequently asked questions
- What is the difference between sort A to Z and natural sort?
- Sort A to Z compares the text character by character, so item10 comes before item2 because 1 is smaller than 2. Natural sort reads runs of digits as numbers, so item2 comes before item10. It also follows the language rules of your browser for letters with accents.
- Which duplicate is kept?
- The first one. Later copies are removed and the lines keep their original order. With Ignore case on, Apple and apple count as the same line.
- How are upper and lower case sorted?
- Plain sorting puts all capital letters before lower-case letters, because it compares character codes. Tick Ignore case to sort without regard to case.
- Are line breaks kept?
- A final line break at the end of the text is kept. Windows line breaks are written back as ordinary line breaks.
- Is my list uploaded?
- No. The operations run in your browser.