Text Sorter
Sort lines alphabetically, by length, or remove duplicates.
About Text Sorter
Paste any multiline text and sort each line alphabetically, reverse alphabetically, or by length. Options let you remove duplicate lines, normalize case before comparison, and trim leading/trailing whitespace from each line before processing.
FAQ
- How does alphabetical sorting work?
- Lines are sorted using JavaScript's built-in localeCompare, which handles special characters correctly.
- Can I sort numbers?
- Alphabetical sort treats numbers as text. For numeric sorting, use the length sort as a workaround or ensure numbers are zero-padded.
- Does this handle blank lines?
- Blank lines are treated as empty strings and sorted to the top in A→Z mode. Use Trim Lines to remove them.
ABOUT THIS TOOL
Paste a list of lines and sort them alphabetically, in reverse alphabetical order, by line length, or strip out duplicate lines, all in a single step without opening a spreadsheet or code editor. Each line is treated as one item, so it works for anything you keep as a plain list: names, URLs, tags, ingredients, CSS classes, or import statements. Sorting happens instantly in your browser as you change options, so you can compare alphabetical order against length-based order to see which is clearer for your use. It's a fast way to turn a messy, unordered paste from an email, spreadsheet column, or notes app into a clean, consistent list ready to reuse.
HOW TO USE
- Paste your list into the input box, one item per line.
- Pick a sort mode: A to Z, Z to A, shortest first, or longest first.
- Turn on duplicate removal if you want only unique lines.
- Check the output panel for the reordered list.
- Copy the result and paste it back into your document or spreadsheet.
COMMON USE CASES
- Alphabetizing a bibliography or works-cited list before submitting a paper
- Deduplicating a list of email addresses collected from multiple sign-up forms
- Sorting CSS class names or import statements so a codebase's style stays consistent
- Organizing a recipe's ingredient list alphabetically for easier scanning while shopping
- Cleaning up a list of keywords pulled from several spreadsheets into one unique set
TIPS & COMMON MISTAKES
- Sorting is typically case-sensitive, so uppercase and lowercase versions of the same word can land in different positions than expected
- Trailing spaces or invisible characters count as part of a line, so near-duplicates with extra whitespace may not get merged
- Sorting by length only orders by character count, lines of equal length keep their original relative order
- Remove stray blank lines before sorting, or they'll get shuffled into the result as empty entries
MORE QUESTIONS
- Does the tool change my original pasted text?
- No, it only reorders what's shown in the output box. Your original input stays in the input field until you replace or clear it yourself.
- How are numbers handled in alphabetical sort?
- Numbers sort as text characters, not as numeric values, so '10' comes before '2' because '1' is compared before '2' character by character.
- Will removing duplicates catch lines that only differ in capitalization?
- Typically no, exact-match deduplication treats 'Apple' and 'apple' as different lines since the comparison is case-sensitive by default.
- Can I sort a list that mixes short phrases and single words?
- Yes, alphabetical sort works fine on mixed content since it compares character by character regardless of phrase length; length-based sort is more useful if you specifically want to group short and long entries.