PublicSoftTools

Text Sorter

Sort lines of text alphabetically, reverse the order, shuffle them randomly, or remove duplicate lines. Paste your list and click the operation — results appear instantly.

Text Sorter

Uses for the Text Sorter

Sort Todo Lists

Paste your task list, sort A–Z, and get a consistently ordered list that is easier to scan and prioritise. Works great for project task lists and grocery lists alike.

Deduplicate Mailing Lists

Paste a list of email addresses or names, click "Remove Duplicates", and get a clean unique list. Saves time compared to manual scanning for duplicates.

Randomise Survey Questions

Shuffle a list of survey questions or answer choices to randomise their order for different respondents. Reduces order bias in questionnaire design.

Sort Code Import Lists

Many style guides require sorted import statements. Paste your imports, sort A–Z, and paste back. Much faster than sorting manually in an editor.

Reverse for LIFO Processing

If you have a chronological list and need to process the most recent items first, click "Reverse" to invert the order without manually reordering each line.

Clean Word Lists for NLP

Sort and deduplicate keyword lists, vocabulary sets, or stopword lists before using them in natural language processing pipelines or search tools.

Frequently Asked Questions

How does alphabetical sorting work?

Lines are sorted using the locale-aware localeCompare function, which correctly handles accented characters and Unicode text. Sorting is case-insensitive in terms of collation order — uppercase and lowercase versions of the same letter sort together according to the locale rules of the browser.

What does "Remove Duplicates" do?

"Remove Duplicates" keeps only the first occurrence of each unique line and discards subsequent duplicates. The comparison is case-sensitive — "Apple" and "apple" are treated as different lines. The original order of first-seen lines is preserved.

Is the Shuffle truly random?

Shuffle uses Math.random(), which produces a pseudo-random sequence from the browser's built-in random number generator. This is suitable for most practical purposes but is not cryptographically secure. For security-critical randomness, use a dedicated cryptographic tool.

Can I sort a list of numbers?

The tool sorts lines as text strings, not as numbers. This means "10" sorts before "2" in A–Z order because "1" comes before "2" as characters. If you need numeric sorting, convert your list to zero-padded numbers (01, 02, 10) before sorting.

Is there a line limit?

No hard limit. The tool processes text in your browser's memory. In practice, lists of tens of thousands of lines sort instantly. Extremely large lists (millions of lines) may cause brief lag in some browsers.

Does it work with non-English text?

Yes. Sorting uses localeCompare, which handles Unicode and accented characters correctly for most languages. The sort order may vary slightly by browser locale setting, but Latin-script languages (including French, German, Spanish, and Portuguese) are handled well.