DevToolsForYou
Private by defaultRuns in your browser

Text sorter

Paste any list and sort it the way you need — alphabetically, numerically, or reversed. Options for case-insensitive sort and deduplication included.

Quick samplesUseful for testing
Text Sorter

About this tool

Sorting text is more opinionated than it looks. The default in almost every programming language is lexicographic ordering by character code, which puts all uppercase letters before all lowercase ones — so Zebra sorts before apple — and orders numbers as strings, so 10 lands between 1 and 2. Both behaviours are correct by the rules being applied and wrong by the expectations of anyone reading the output. Natural sorting fixes the numeric case by comparing digit runs as numbers, which is why file managers show file10 after file9. Locale-aware collation fixes the alphabetical case, and its rules differ by language: Swedish sorts ä after z, German sorts it with a, and Spanish once treated ch as its own letter. For most everyday work — tidying an import list, ordering CSV columns, alphabetising names, ordering log entries — case-insensitive alphabetical or numeric sorting is what you want. This tool sorts pasted lines ascending, descending, or shuffled, with options for case-insensitive and numeric comparison and for removing duplicates in the same pass. It runs in your browser.

No signup requiredRuns in your browserInstant results
How to use
  1. 1

    Paste the lines of text you want to sort into the input field.

  2. 2

    Choose ascending (A→Z), descending (Z→A), or random shuffle.

  3. 3

    Optionally enable case-insensitive sorting or numeric sorting.

  4. 4

    Click Copy to copy the sorted output.

Why use this tool?
  • →

    Sort a list of names, tags, or keywords alphabetically before pasting into a doc.

  • →

    Numerically sort log lines that start with counts or IDs.

  • →

    Reverse-sort a changelog or timestamped list to put the newest entries first.

ExamplesInput → output

Sort alphabetically

Inputbanana apple cherry date
Outputapple banana cherry date

Sort numerically

Input10 3 25 1 8
Output1 3 8 10 25
Common errorsAnd how to fix them

Numbers sort as 1, 10, 100, 2

Cause: String sorting compares character by character, and the character 1 sorts before 2 regardless of how many digits follow it.

Fix: Enable numeric sorting so digit sequences are compared as values. Where the data mixes text and numbers, such as item2 and item10, numeric mode handles the digit runs within each line.

Uppercase entries all cluster at the top

Cause: Case-sensitive sorting orders by character code, and every uppercase ASCII letter has a lower code than every lowercase one.

Fix: Enable case-insensitive sorting. Note that this changes ordering only, not the text itself — the original capitalisation is preserved in the output.

Accented characters sort after z

Cause: Character-code ordering places accented Latin letters in a block above the unaccented ASCII range, so é lands after z rather than beside e.

Fix: For lists with accented text, expect this ordering and adjust by hand, or sort in a tool with locale-aware collation. Which position is correct genuinely depends on the language.

Frequently asked questionsCommon questions answered

These answers explain common text sorter tasks, expected input formats, and edge cases so both visitors and search engines can understand what this tool does.

What sort modes are available?

Alphabetical (A→Z), reverse alphabetical (Z→A), numerical ascending, and numerical descending. Numerical mode compares the numeric value at the start of each line.

What happens to lines that aren't numbers in numerical sort?

Lines with no leading number are treated as zero and sorted to the beginning of ascending results or end of descending results.

Does case-insensitive sorting change the output text?

No. It only affects the sort order — 'Apple' and 'apple' are grouped together — but the original casing of each line is preserved in the output.

Can I remove duplicates while sorting?

Yes. Enable the Remove duplicates option to keep only the first occurrence of each line after sorting.