Line Sorter
Sort lines alphabetically, reverse, deduplicate, or shuffle them instantly online. Free line sorter tool — paste text, pick an operation, copy the result. No signup required.
Input Lines
Output Lines
Related Tools
Markdown → HTML
Convert Markdown to clean HTML instantly. Supports GFM, tables, code blocks, and more.
Case Converter
Convert text to camelCase, PascalCase, snake_case, kebab-case, and more — all at once.
HTML → Markdown
Convert HTML to clean Markdown instantly. Supports headings, links, lists, tables, and code blocks.
Sorting and deduplicating lines of text is a foundational data-cleaning operation that appears constantly in software development, data engineering, and content editing. Unix systems have provided the sort and uniq command-line utilities for this purpose since the 1970s, but those require a terminal and familiarity with flags like -u, -r, and -f.
Line sorting is used when normalising word lists for spell checkers, ordering CSS class definitions, cleaning up .gitignore entries, preparing import lists for Python or TypeScript files, and deduplicating email subscriber exports before uploading to Mailchimp or HubSpot. The operation is simple but tedious to do manually in a text editor.
This tool offers five operations: alphabetical ascending (A→Z), descending (Z→A), reverse order (flip line sequence), deduplicate (remove exact duplicate lines), and shuffle (Fisher-Yates randomization). Deduplicate mode displays a count of removed lines. All processing runs in the browser with no data leaving your machine.
Common Use Cases
Cleaning .gitignore files
Over time a .gitignore accumulates duplicate entries as team members append patterns without checking existing content. Pasting the file into the deduplicator removes exact duplicates, then running A→Z sort groups similar patterns together, making the file easier to audit and maintain in code review.
Sorting CSS utility class lists
Tailwind CSS projects often enforce alphabetical class ordering via Prettier plugins, but legacy codebases have unsorted class strings scattered across HTML templates. Extracting class names one-per-line, sorting A→Z, and pasting back produces output compatible with prettier-plugin-tailwindcss expectations and makes diffs cleaner in pull requests.
Deduplicating email or domain lists
Marketing teams frequently merge exported CSVs from Salesforce, HubSpot, and manual spreadsheets before importing to an email platform. Pasting the email column, deduplicating, and sorting alphabetically catches exact-match duplicates instantly without needing Excel's Remove Duplicates feature or a Python script, reducing bounce rates and list-hygiene issues.
Randomising quiz or survey options
When preparing multiple-choice questions for a Google Form or a Typeform survey, answer options should appear in random order across different versions to reduce position bias. Pasting the answer list and shuffling produces a randomised sequence that can be pasted directly into the form builder without manual rearrangement.
Line Operations Explained
- A → Z — alphabetical sort using locale-aware comparison
- Z → A — reverse alphabetical sort
- Reverse — flips the order of lines without sorting
- Deduplicate — removes duplicate lines, preserving first occurrence
- Shuffle — randomises line order using Fisher–Yates algorithm