Sort lines

Paste a list and it sorts itself — by your language’s rules, no button.

How to use it

  1. Paste your list into the box, one item per line — it is sorted as you type, there is no button to press.
  2. Pick a direction, then switch the options you need: “Numbers by value” for numbered items, “Ignore case”, “Remove blank lines”, “Remove duplicates”.
  3. Check the line count, then copy the result or download it as a .txt file.

Example

Input

Banana
apple
item 10
Cherry
item 2

Sorted

apple
Banana
Cherry
item 2
item 10

Default rules only (ascending, numbers by value, blank lines removed, no dedupe): letters decide first, so a capital “B” does not jump ahead of “apple”, and “item 2” comes before “item 10” because numbers are compared by value. Five lines in, five lines out.

Rules, limits and known issues

  • Sorting uses the browser’s built-in collation for the page language: English by A–Z, Chinese by pinyin, Arabic by the Arabic alphabet. It is not code-point order — code-point order would put “张” before “李” and “第10章” before “第9章”.
  • Pinyin order comes from the browser’s collation data, so browsers with different ICU versions can order a few characters slightly differently. The examples on this page are the reference.
  • “Numbers by value” compares digit runs as numbers: “item 2” before “item 10”, “第2章” before “第10章”. Turn it off to compare character by character.
  • With numbers by value on, “01” and “1” compare as equal: both lines are kept and their order stays as you typed it.
  • “Remove duplicates” drops only lines that are identical character by character — “Apple” and “apple” are both kept even with “Ignore case” on.
  • A blank line is one that is empty or contains only whitespace (space, tab, U+00A0, U+3000). Lines are never trimmed, so leading indentation still affects the order; clean the text first if you need that.
  • Output uses LF line breaks and has no trailing newline. A textarea already normalizes CRLF/CR, so there is no “keep original line breaks” switch.
  • Nothing is normalized: your lines are printed exactly as typed (a combining accent is never rewritten into a single code point). When comparing, the browser does treat “é” (one code point) and “e” plus a combining accent as equal — they stay next to each other in the order you typed. No sorting by length, no shuffle, no sorting by column, no file upload, no history — nothing is uploaded or stored.

What people usually need next, once the list is sorted.