Text Sorter

Enter one item per line, choose a sort mode, and get your sorted result instantly. Six sort modes plus remove duplicates, case insensitive, and trim whitespace options.

Sort Modes Explained

  • A → Z: Alphabetical ascending order. Numbers and symbols sort before letters.
  • Z → A: Alphabetical descending order — reverse alphabetical.
  • Shortest First: Lines with fewer characters appear at the top.
  • Longest First: Lines with more characters appear at the top.
  • Randomize: Lines are shuffled into a random order. Use Re-shuffle for a new order.
  • Reverse Order: The last line becomes the first, and the first becomes the last.

Frequently Asked Questions

How does the text sorter work?

The text sorter treats each line of input as a separate item. It then sorts those lines according to the selected mode — alphabetically, by length, randomly, or in reverse order.

What does case insensitive sorting mean?

When case insensitive is enabled, "Apple" and "apple" are sorted as if they are the same word (both treated as "apple"). Without it, uppercase letters sort before lowercase in ASCII order.

What does "Remove Duplicates" do during sorting?

When "Remove duplicates" is enabled, any line that appears more than once is deduplicated — only the first occurrence is kept. Combined with case insensitive, "Apple" and "apple" are treated as the same duplicate.

Can I sort a numbered list?

Yes. Paste each list item on a separate line. For numbered lists like "1. Apple\n2. Banana", alphabetical sort will sort by the number prefix, which may not be what you want — remove the numbers first for a clean alphabetical sort.

How does the Randomize/Shuffle mode work?

Shuffle uses the Fisher-Yates algorithm (via Math.random()) to randomly rearrange all lines. Click "Re-shuffle" to get a new random order without re-entering your text.

Is there a limit to how many lines I can sort?

There is no hard limit. The tool runs in your browser and handles thousands of lines quickly. Sorting very large datasets (100,000+ lines) may take a second on older devices.

What common tasks can I use this sorter for?

Common uses include: sorting keyword lists alphabetically, deduplicating email addresses, randomising quiz questions, alphabetising bibliography entries, and sorting to-do lists.

Does trim whitespace affect sorting?

Yes. When trim is enabled, leading and trailing spaces are removed from each line before comparison and output. This prevents " apple" and "apple" from being treated as different items.

Related Text Tools