Dev Utilities

Dev Utilities › Text Tools › Text Sorter

Text Sorter

Paste a list — one item per line — and sort it the way you need: A–Z, Z–A, shortest or longest first, in natural number order, reversed, or shuffled at random. Sorting happens instantly, in your browser.

Quick answer: put each item on its own line, choose a sort order, and the sorted list appears in the output box below. “Natural” order reads embedded numbers as numbers, so Item 2 sorts before Item 10; tick the cleanup options to drop blank lines and duplicates in the same pass.

Try an example:

0
Lines in result
0
Lines in input
0
Duplicates removed
0
Blank lines removed

Send result to…

Carry the sorted list straight into the next step of your workflow. The text travels in the link itself — if a tool ever opens empty, it has also been copied, so just paste it in.

Your session

Sort history

Every sort you run is kept here for this session only, so you can step back or restore an earlier list. Nothing is stored — it all disappears when you close the page.

  • No sorts yet — run a sort and it will appear here.

Your tools rail

Star the tools you reach for most; tools you open from this page collect under “Recently used”. Both lists live for this session only.

Favorite tools

No favorites yet — tap a ☆ below.

Recently used

Tools you open from here will appear in this list.

    How to sort text online

    1. Paste your list into the left box, one item per line — names, products, filenames, anything. A sample list is pre-loaded so you can see the sorter working.
    2. Choose a sort order. A–Z for ordinary lists; natural order when lines contain numbers (file2 before file10); shortest-first to surface terse entries; shuffle for a fair random order.
    3. Set the cleanup options. Trim stray spaces, drop blank lines, and remove duplicates — matching respects the case-sensitivity setting.
    4. Take the result. Copy it, download it as a .txt file, or press “Use result as input” to sort the output again under a different order.

    Worked example

    The sample loaded above has six lines: Mango, apple, Banana, cherry, 10 eggs, 2 eggs. Sorted with the default settings — natural order, case-insensitive, blanks removed — the result is:

    2 eggs
    10 eggs
    apple
    Banana
    cherry
    Mango

    Numbers come first and are read as numbers, so 2 eggs sorts before 10 eggs — a plain character-by-character sort would reverse them. Among the words, case is ignored, so apple (a) precedes Banana (b), then cherry (c) and Mango (m). Now switch the order to plain “A–Z (plain alphabetical)” and watch “10 eggs” jump ahead of “2 eggs” — that one swap is the whole difference between natural and plain sorting.

    Which sort order should you use?

    A–Z and Z–A

    The everyday orders for name lists, glossaries, product catalogues and indexes. A–Z reads top-down like a dictionary; Z–A is handy when the end of the alphabet matters most, or when a system pastes a sorted list in reverse.

    Natural number order

    File managers use natural order for a reason: humans read “Chapter 10” as a bigger number than “Chapter 2”. Use it for filenames, version strings, street addresses, SKUs and any label where digits carry quantity, not just characters.

    By length

    Shortest-first surfaces one-word answers, terse headlines and empty-ish entries that need attention. Longest-first finds the entries that will break a layout, overflow a label or blow a character budget — a quick QA pass for imported data.

    Reverse and shuffle

    Reverse simply flips the current order without re-sorting — useful after pasting an already-sorted list upside down. Shuffle produces a fair random order using cryptographic randomness, suited to draw orders, rotations and blind review queues. For pure alphabetical sorting of lines and individual words, see the dedicated Alphabetical Sorter.

    Frequently asked questions

    What is the difference between the Text Sorter and the Alphabetical Sorter?

    The Text Sorter is the general-purpose tool: it sorts lines A–Z or Z–A, but also by length, in natural number order, in reverse, or randomly, with duplicate and blank-line cleanup. The Alphabetical Sorter focuses on alphabetical order alone, including sorting individual words within text. Use this page when order means more than just A–Z.

    What does natural number order mean?

    Natural order sorts numbers the way people read them, so “2 eggs” comes before “10 eggs” because 2 is smaller than 10. A plain alphabetical sort compares character by character and would put “10 eggs” first, because the character “1” comes before “2”. Use natural order for filenames, version numbers, addresses and any list with embedded numbers.

    Should sorting be case-sensitive?

    Usually not. With case-insensitive sorting (the default), “apple” and “Apple” sort together by their letters. With case-sensitive sorting, capital letters sort before lowercase ones, so “Banana” can end up far away from “banana”. Turn case sensitivity on only when capitals carry meaning, such as in codes or case-sensitive identifiers.

    Can I sort and remove duplicates at the same time?

    Yes. Tick “Remove duplicate lines” and the output keeps only the first occurrence of each line. Matching follows the case-sensitivity setting: with case-insensitive sorting, “Apple” and “apple” count as duplicates; with case-sensitive sorting they are kept as separate lines.

    Is the random shuffle really random?

    Yes. The shuffle uses your browser's cryptographic random source (crypto.getRandomValues) driving a Fisher–Yates shuffle, the same quality of randomness used for security tokens — not the predictable Math.random. Every line is equally likely to land in any position, which makes it fair for prize draws, presentation order and randomized lists.

    Can I send the sorted list to another tool?

    Yes. The “Send result to…” bar under the sorter carries your sorted list into eight follow-on tools — Remove Duplicate Lines, the Alphabetical Sorter, Case Converter, Remove Line Breaks, Whitespace Remover, Text Reverser, Word Counter and Slug Generator. The text travels inside the link itself, and it is also copied as a backup, so a cleanup workflow like sort → dedupe → convert case takes seconds instead of copy-pasting between pages.

    Is my text uploaded or stored?

    No. Sorting runs entirely in your browser with JavaScript. Your text is never sent to a server, stored or shared, and it disappears when you close the page.

    Related text tools

    All 33 tools