Sort a list

Paste a list and get it back sorted. Three modes - alphabetical (Unicode-aware), numeric (parses leading numbers), by length - each with ascending or descending order and an optional case-sensitivity toggle. Output updates live as you change options.

Input
Ready
Output
Live

Three sort modes, one option toggle

Alphabetical mode (default) uses the browser's `localeCompare` with `numeric: true`, which means `"item 10"` sorts after `"item 2"` the way humans expect (not the raw ASCII string compare that gives `10` before `2`). Case sensitivity is togglable - off (default) treats `Alice` and `alice` as equal for ordering; on distinguishes them via `sensitivity: "case"`.

Numeric mode parses each line as a float (`parseFloat`) and sorts by the resulting number. Parsing is prefix-based: `42 apples` parses as 42 (trailing text ignored). Lines that don't read as a plain number (currency, words, empty) parse as `NaN`; under the spec, `NaN` comparator returns are treated as "equal," so non-numeric lines keep their input-relative position in the output (if every line is non-numeric, you get the input back unchanged). They can also prevent adjacent numeric lines from crossing them, so strip them first if you want a clean numeric-only sort. For mixed alphanumeric input, alphabetical mode with `numeric: true` is usually what you want.

By-length mode sorts by character count, falling back to alphabetical order when two items have the same length. Good for finding the longest or shortest entries. Order flips the direction of whichever mode you chose.

How to use sort a list

  1. 1Paste your list into the input panel
  2. 2Pick Mode: Alphabetical (default), Numeric, or By length
  3. 3Pick Order: ascending (A → Z / low → high) or descending
  4. 4Toggle Case sensitive if case differences should affect ordering
  5. 5Output updates live; copy or download the sorted result

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this sorter actually does

Three modes, one case toggle, Unicode-aware comparison.

Alphabetical mode with natural-order numerics

Uses `localeCompare` with `numeric: true`, so `file2` sorts before `file10` (the human expected order). This is the default and the right choice for most lists.

Numeric mode via parseFloat

Each line is parsed as a float; leading digits count and trailing text is ignored (`42 apples` parses as 42). Lines that don't read as a plain number parse as `NaN` and keep their input-relative position (stable sort treats every `NaN` comparison as equal) - strip them first if you want a clean numeric-only result.

By-length mode with alphabetical tiebreak

Sorts by character count. When two items are the same length, alphabetical ordering breaks the tie so the output is stable and predictable.

Case-sensitivity toggle

Off (default) treats `Alice` and `alice` as equal. On uses `sensitivity: "case"` so capitalized items sort distinctly. Only affects alphabetical mode.

Order switch applies to all modes

Ascending is A → Z / low → high / short → long. Descending flips the same ordering. The switch works the same way regardless of mode.

Worked example

Default Alphabetical mode, ascending, case-insensitive. Note the natural-order numerics put `2` before `10`.

Input
Charlie
alice
10
2
Output
2
10
alice
Charlie

Settings reference

How each option shapes the sorted output.

Setting What it does Effect on the sample
Mode: Alphabetical (default) Unicode-aware compare with natural-order numerics `2`, `10`, `alice`, `Charlie`
Mode: Numeric `parseFloat` each line; non-numeric lines compare as "equal" to everything and keep their input-relative position Numeric items order as `2`, `10`; non-numeric items (`alice`, `Charlie`) stay roughly where they were in the input. They can prevent a numeric from crossing them, so for a clean number-only result strip non-numeric lines first
Mode: By length Character count ascending; ties broken alphabetically `2`, `10`, `alice`, `Charlie`
Order: Descending Reverses the ordering for any mode Alphabetical descending: `Charlie`, `alice`, `10`, `2`
Case sensitive: on Distinguishes uppercase and lowercase in alphabetical mode Capitalized entries group separately from lowercase

FAQ

Why does `10` sort before `2` in some sorters but not this one?
Because this tool uses `localeCompare` with `numeric: true`. Plain string compare gives `10` < `2` because it compares character by character. Natural-order numerics correctly parse the embedded number and put `2` before `10`.
What happens to non-numeric lines in Numeric mode?
They parse to `NaN`, which the spec coerces to 0 in comparator returns - the sort treats them as "equal" to every other line. Because `Array.prototype.sort` is stable (ES2019+), they keep their input-relative position; an all-non-numeric input comes out in the same order it went in. They can block adjacent numeric lines from crossing them, so for strict number-only sorting, filter non-numeric lines first using the Filter numbers tool.
Does Case sensitive affect Numeric or By-length modes?
Numeric: no - the comparison is `parseFloat(a) - parseFloat(b)`, which has no letter-case dimension. By-length: on the tiebreak, yes. Length mode compares `line.length` first (case-independent), but when two items tie on length the alphabetical tiebreak reads the toggle - off (default) treats `Apple` / `apple` as equal; on distinguishes them. Most inputs have few or no same-length case-differing items, so you may never see the toggle matter in By-length in practice.
Can I reverse an already-sorted list?
Yes, either flip Order to Descending, or use the dedicated Reverse tool which reverses the current order regardless of sort state.
How do I shuffle instead of sort?
Use the Shuffle tool - it has Fisher-Yates random, interleave, reverse-pairs, and block-shuffle modes. The Sort tool only sorts; it does not randomise.