Line Sorter
Sort lines alphabetically or in natural order, shuffle them, remove duplicate lines, trim whitespace, and reverse line order.
Sorted live as you type. Nothing leaves your browser.
Options
0 lines → 0 lines
How to sort lines of text online
Paste your lines
Drop your text into the input box with one item per line. The result below updates as you type.
Pick a sort order
Choose Original order, A to Z, Z to A, or Shuffle. Original order lets you dedupe or trim without changing the sequence, and Shuffle again reshuffles.
Toggle the options you need
Combine Remove duplicates, Trim lines, Ignore case, Natural sort, and Reverse in any mix. Each toggle reapplies instantly.
Copy the output
Check the line count above the output to see how many lines survived, then click Copy to clipboard.
Why use this tool
Alphabetical or natural order
A to Z and Z to A use locale-aware alphabetical comparison. Turn on Natural sort and numbers inside your lines order by value, so item2 comes before item10 instead of after it. Original order keeps your sequence so you can dedupe or trim on its own.
Duplicate removal keeps the first hit
Remove duplicates drops every repeat after the first occurrence. With Ignore case on, Apple and apple count as the same line.
A fixed, predictable pipeline
Options apply in order: trim first, then dedupe, then sort or shuffle, then reverse. Apart from Shuffle, the same input and settings always give the same output.
Shuffle into a random order
Shuffle drops sorting and arranges your lines at random. Pick Shuffle again to reshuffle into a fresh order, handy for randomising a draw or a running order.
Line counts before and after
A counter above the output shows how many lines went in and how many came out, so you can see exactly what deduplication removed.
Runs on your device, costs nothing
Sorting is done in your browser with no account and no upload, and it keeps working offline once loaded.
About this tool
This line sorter treats each line of your text as an item in a list. It splits the input on newlines, then runs the enabled operations in a fixed order: Trim lines strips leading and trailing whitespace, Remove duplicates keeps the first occurrence of each line, the sort compares lines with locale-aware alphabetical ordering (A to Z or Z to A), and Reverse flips the final sequence. Ignore case affects both comparison and deduplication, so it makes Apple and apple sort together and count as one line. Turn on Natural sort and numbers inside your lines order by their value, so item2 lands before item10 rather than after it. Shuffle replaces sorting with a random order, and picking Shuffle again reshuffles into a fresh arrangement.
It earns its keep on list chores: alphabetising names for a programme or roster, deduplicating an email or keyword list before importing it somewhere, tidying a block of import statements, or flipping a log excerpt so the newest entries come first. Natural sort keeps versioned or numbered items in a sensible order, and Shuffle randomises a list to pick a winner or set a running order. The before-and-after line counter is handy when deduping, because it tells you at a glance how many repeats the original contained without counting anything by hand.
Your list never leaves the page; everything runs in browser memory. For character-level cleanup like collapsing double spaces inside lines, use the whitespace remover. If your lines came out of a spreadsheet, CSV to JSON converts them into structured data, and word counter reports totals for the finished text.
Frequently asked questions
- How does the line sorter work?
- Paste your lines into the input box, one per line. Pick a sort order and any options you want, and the result updates instantly below. Click the copy button to copy the sorted lines to your clipboard.
- How do sorting and removing duplicates behave?
- A to Z and Z to A order your lines using locale-aware alphabetical comparison. Turn on Ignore case to treat uppercase and lowercase letters the same. Remove duplicates keeps the first occurrence of each line and drops the rest. Trim lines strips leading and trailing whitespace, and Reverse flips the final order after sorting.
- What do Natural sort and Shuffle do?
- Natural sort orders numbers inside your lines by their value, so item2 lands before item10 instead of after it, which keeps versioned and numbered lists in a sensible order. Shuffle throws out sorting and arranges the lines in a random order. Pick Shuffle again to reshuffle into a fresh order.
- Are my lines uploaded anywhere?
- No. The line sorter runs entirely in your browser. Your text never leaves your device, never touches a server, and is not stored or logged.
- Is there a limit on how many lines I can sort?
- There is no hard limit. The tool can comfortably handle tens of thousands of lines. For very large inputs you may notice a brief pause while your browser processes the change.
Related tools
CSV to JSON
Paste CSV and get a clean JSON array of objects, with header detection and automatic number and boolean typing.
JSON Formatter & Validator
Pretty-print, minify, or explore JSON as a collapsible tree, with syntax errors shown inline.
Add Line Numbers
Prefix every line of your text with a number. Set where the count starts, choose a separator, pad with leading zeros, and skip blank lines.
Alternating Case Generator
Turn text into aLtErNaTiNg caps, the mocking SpongeBob style.
Case Converter
Switch text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case, and more.
Email Extractor
Pull every email address out of any text, then deduplicate, sort, lowercase, and copy the clean list.