Command Palette

Search for a command to run...

LI

Line Sorter

Sort lines of text alphabetically, numerically, or by length, reverse or shuffle them, and remove duplicates, blank lines, and whitespace - all in your browser.

What is the Line Sorter?

The Line Sorter takes a block of text and reorders it line by line. You can sort alphabetically, numerically, or by line length, reverse the order, or shuffle randomly, and clean the list at the same time by trimming whitespace, dropping blank lines, and removing duplicates.

Sorting lists by hand is tedious and error-prone, especially with mixed case, numbers, or duplicate entries. This tool handles all of that instantly: it uses a natural, case-aware comparison so that "item2" comes before "item10", and it can fold case so "Apple" and "apple" are treated as the same entry when removing duplicates.

Everything runs in your browser. Paste your list, choose how to sort and clean it, and copy the result. No account, no uploads, and it keeps working offline once the page has loaded - safe for sensitive lists that should never leave your machine.

Alphabetical and natural sorting differ in one way that matters constantly. A plain character-by-character sort puts file10 before file2, because the character 1 sorts before 2. The alphabetical mode here is natural-sort aware: it reads runs of digits as numbers, so file2 comes first, and a list of whole numbers like 2 and 10 also comes out in value order. Numeric mode still matters for decimals and negative numbers, which a natural sort reads as separate runs of digits (3.14 lands after 3.2, and -10 after -5), and it moves lines that do not start with a number to the bottom. Case is the other axis. The comparison is locale-aware rather than raw byte order, so even with ignore-case off, Apple and apple sit next to each other instead of every capitalized line sorting ahead of every lowercase one. Ignore-case removes capitalization from the comparison entirely, and entries that differ only in case keep their original order. Removing duplicates compares whole lines, so two lines differing only by trailing whitespace are not duplicates, which is why the cleaning options exist and are worth running first. Sorting happens in memory, so very large files are bounded by the tab.

How to use the Line Sorter?

  1. Paste your list

    Paste or type your text into the input box, one item per line.

  2. Choose a sort mode

    Pick alphabetical, numeric, or length sorting, or use reverse or shuffle. Toggle descending to flip the order.

  3. Clean the list

    Turn on options to trim whitespace, remove blank lines, remove duplicates, and ignore case so the output is exactly what you need.

  4. Copy the result

    The sorted, cleaned list appears instantly with a count of how many lines were removed. Copy it to your clipboard in one click.

Key Features

  • Multiple Sort Modes

    Sort alphabetically, numerically, or by line length, plus reverse the current order or shuffle the list randomly

  • Natural, Case-Aware Sorting

    Numeric-aware comparison keeps item2 before item10, and an ignore-case option treats mixed-case entries consistently

  • One-Pass Cleaning

    Trim whitespace, drop blank lines, and remove duplicate lines in the same operation, with a live count of removed lines

  • Instant Results

    The output updates as you type and toggle options, so you see the sorted list immediately with no button to press

Frequently Asked Questions

Paste your list into the Line Sorter with one item per line and choose the alphabetical sort mode. The tool reorders the lines instantly and you can copy the result. Turn on ignore-case if capitalization should play no part in the order.

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!

line sortersort linesalphabetical sortsort text onlineremove duplicate linessort listreverse linessort words alphabetically