KKwikfig.

Text Sorter

Sort a list of lines alphabetically, numerically or by length, ascending or descending, with an optional duplicate-removal pass in the same operation. Runs entirely in your browser — your numbers never leave this device.

Sort by
Direction
Lines, one per line
Sorted

How it works

Alphabetical: locale-aware comparison, case-insensitive, with numbers inside lines compared by value (item2 before item10) | Numeric: lines compared by their leading numeric value | Length: lines compared by character count, ties broken alphabetically

Paste a list, one item per line, choose how to sort it, and the lines are rearranged — the contents of each line are never altered, only their order. Alphabetical sorting is locale-aware and numeric-aware: it compares the way a person would, ignoring case for ordering purposes and reading embedded numbers by value, so item2 sorts before item10 instead of after it (the trap plain character sorting falls into, because the character “1” precedes “2”).

Numeric mode compares lines by their leading number, which is what lists of measurements, prices and scores need — text after the number rides along with its line, and a line with no number counts as zero. Length mode orders lines by character count, shortest or longest first, with alphabetical order breaking ties so the result is deterministic. Direction reverses any mode, and an optional duplicate-removal pass deletes exact repeated lines before sorting, which pairs naturally with the Remove Duplicate Lines tool when you also need its trim and case options.

Sorting runs in your browser on your own device. Lists of names, products or keywords are never uploaded or stored — close the tab and the list is gone.

Worked examples

Numeric sorting beats alphabetical for numbers

Input
10 2 33 4 (4 lines), Mode = numeric, Direction = ascending
Working
Compared as numbers, the values order as 2, 4, 10, 33. Alphabetical sorting would have produced 10, 2, 33, 4 — the classic trap this mode exists to avoid.
Result
2, 4, 10, 33 on successive lines

Shortest line first

Input
ccc a bb (3 lines), Mode = length, Direction = ascending
Working
Character counts are 3, 1 and 2, so the lines order by count: the 1-character line, then the 2-character line, then the 3-character line.
Result
a, bb, ccc on successive lines

Descending alphabetical order

Input
banana apple cherry (3 lines), Mode = alphabetical, Direction = descending
Working
Ascending order would be apple, banana, cherry; descending reverses the comparison, putting cherry first.
Result
cherry, banana, apple on successive lines

Frequently asked questions

Why does item2 come before item10 here but not in my spreadsheet?

This sorter compares alphabetically with numeric awareness: when two lines contain numbers at the same position, the numbers are compared by value (2 is less than 10), not character by character. A plain character sort compares “1” against “2” first and puts item10 before item2. If you ever need the plain behaviour, that is what most code editors' built-in sort does.

How does numeric mode treat lines that are not numbers?

Each line is read for its leading numeric value — “42 kg” counts as 42 — and a line with no leading number counts as 0, so headings and labels collect at the top in ascending order. The whole line moves with its number; nothing is stripped or reformatted.

Is the sort case-sensitive?

No. Alphabetical comparison ignores case for ordering (base sensitivity), so “apple” and “Apple” sort as equals and “Banana” files under B alongside “banana”, the way a dictionary or a phone contacts list behaves. The lines themselves keep their original capitalisation — only their positions change.

What is the difference between the dedupe option here and Remove Duplicate Lines?

Scope. The toggle here removes exact duplicate lines (character-for-character matches) as a convenience before sorting. The dedicated Remove Duplicate Lines tool adds the options real cleanup usually needs: trimming surrounding spaces before comparing, case-insensitive matching, and a report of how many lines were removed.

Can I sort by the last word, or by a column?

Not in this tool — it sorts whole lines by their start (or their length). For surname sorting, put the surname first using Find and Replace in regex mode to swap name order, then sort. Column-based sorting belongs in a spreadsheet; pasting a single column here and sorting it is still quicker for a one-off list.

Is my list uploaded anywhere?

No. Sorting runs entirely in your browser; your list is never sent to a server, stored or tracked.

Related tools

More in Text Tools · Browse all tools