Sort Lines
Paste any list and sort lines alphabetically A-Z or Z-A, by character length, or shuffle into a random order — all processing is client-side in your browser, so your data never leaves your device. Preview the result before applying.
Input Text
Sort Mode
Choose how lines should be ordered, then click Apply.
Sort lines alphabetically from A to Z using Unicode-aware lexicographic comparison.
Sort lines in reverse alphabetical order from Z to A.
Order lines by character count, placing the shortest line at the top.
Order lines by character count, placing the longest line at the top.
Randomize the order of all lines using the Fisher-Yates shuffle algorithm.
Treat uppercase and lowercase as different values — "Banana" sorts before "apple" in case-sensitive mode.
Why Use This Tool?
Sorting lines of text is one of the most common data-cleaning tasks — whether you are alphabetising a word list, ranking URLs by length, organising config keys, or randomising quiz question order. This sort lines tool applies the operation instantly inside your browser using Unicode-aware lexicographic comparison for alphabetical sorts and the Fisher-Yates algorithm for shuffling. Your data never leaves your device.
Alphabetical Sorting: Sort any list A-Z or Z-A using JavaScript's localeCompare for correct Unicode handling — works with accented characters, mixed-case entries, and multilingual text.
Sort by Character Length: Order lines by their character count to quickly surface the shortest or longest entries — useful for cleaning API response fields, formatting code, or finding outlier strings.
Shuffle Lines: Randomise line order with the Fisher-Yates algorithm, which guarantees a statistically uniform distribution — every permutation has an equal probability of appearing.
Case-Sensitive Toggle: Control whether uppercase and lowercase letters sort as distinct values — enable case-sensitive mode when sorting programming identifiers, file names, or any list where capitalisation carries meaning.
Before/After Preview: Inspect the reordered list in a side-by-side panel before committing — see exactly how your lines will look after sorting, then click Apply only when the result is what you need.
How to Use It
- 1
Paste your list into the text area above — one item per line. You can paste from a spreadsheet column, a log file, or any other source.
- 2
Choose a sort mode: A → Z, Z → A, Shortest First, Longest First, or Shuffle. Toggle Case Sensitive if capitalisation matters for alphabetical sorts.
- 3
Review the Preview panel to see the reordered lines before committing. The After column shows exactly how your text will look once you apply.
- 4
Click Apply to update the text area with the sorted result, then Copy Result to send it to your clipboard.
Frequently Asked Questions
Explore More Free Text Tools
Word Counter
Count words, sentences, readability score, and more in real time.
Find & Replace
Find and replace text with optional regex support.
Case Converter
Convert text to uppercase, lowercase, title case, and more.
Compare Text
Diff two text blocks and highlight every change.
Remove Spaces
Remove extra spaces, fix PDF line breaks, and clean up text.