Text Sorter
Sort lines of text alphabetically, by length, in reverse, or randomly.
Sort lines of text alphabetically or by length online: free list organizer
Sorting a list manually is one of the most repetitive text tasks there is. Whether you need to alphabetise a list of keywords, organise a set of CSS class names, deduplicate a list of URLs, or randomise items for a raffle, this tool handles all of it with one click.
Six sort modes cover the most common scenarios: alphabetical ascending and descending, by character length, reverse input order, and random shuffle. Toggle options to strip whitespace and remove duplicates before sorting to keep your output clean.
Step-by-step guide
- 1Paste your list into the input box
Each line in the text area is treated as one item. You can paste any newline-separated list: names, URLs, keywords, file paths, etc. - 2Choose a sort order
Select A→Z, Z→A, Shortest first, Longest first, Reverse order, or Shuffle. The order can be changed at any time before sorting. - 3Configure options
Toggle case sensitivity, remove duplicate lines, trim leading/trailing whitespace, and remove empty lines as needed. - 4Click Sort (or press Ctrl+Enter)
The sorted output appears in the right-hand panel. You can re-sort with different options as many times as you like. - 5Copy or swap the result
Click Copy to copy the output to your clipboard, or click Swap to move the output back to the input for chained sorting operations.
Related Tools
Word Counter
Live word, character, sentence, and paragraph counts. Reading time, speaking time, top word frequency, and more.
Case Converter
Instantly convert text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, and kebab-case.
Slug Generator
Convert any text to URL-safe slugs with custom separators, case options, accent transliteration, and max length control.
Text Cleaner
Strip extra whitespace, remove special characters, normalize line endings, and clean up messy copy-pasted text.
Frequently Asked Questions
- How does alphabetical sorting work?
- Lines are sorted using JavaScript's localeCompare, which handles language-specific ordering correctly. With case sensitivity off, 'Apple' and 'apple' are treated as equal and sorted stably.
- What does 'Remove duplicates' do?
- Duplicate lines are identified after optional whitespace trimming. Only the first occurrence of each line is kept. With case sensitivity off, 'Hello' and 'hello' are treated as duplicates.
- Can I sort a CSV or TSV file?
- Paste the rows (one per line) into the input and sort them. The tool sorts each line as a whole string, not by individual columns. For column-based sorting, a spreadsheet tool is more appropriate.
- What is the 'Shuffle' mode?
- Shuffle randomises the line order using a Fisher-Yates algorithm, giving each permutation an equal probability. Useful for randomising quiz questions, names in a raffle, or test data.
- Does the sort preserve original line endings?
- Lines are joined with Unix line endings (\n) in the output. Windows-style CRLF endings in the input are handled gracefully.
- Is there a line limit?
- No hard limit. All sorting runs in your browser with no server round-trips, so performance depends on your device. Tens of thousands of lines sort in milliseconds on modern hardware.
- Can I sort numerically?
- The current sort modes are lexicographic (alphabetical) or by character length. For numeric sorting, you would need a spreadsheet tool. Natural sort order (treating '10' as greater than '9') is not yet supported.
- What is the keyboard shortcut?
- Press Ctrl+Enter (or Cmd+Enter on Mac) to trigger the sort without reaching for the Sort button.
- Is my text saved or sent anywhere?
- No. All sorting happens locally in your browser. Your text is never sent to any server.
AlteredIdea vs alternatives
vs Google Docs / Word: Both offer basic A–Z sort for paragraphs but lack length-based sorting, deduplication, shuffle, and the Swap function for chaining operations.
vs browser extensions: No install needed, works offline after the page loads, and your text is not accessible to any extension.
vs paid SEO tools: Free, instant, no account. Sort and deduplicate keyword lists without a subscription.