Verify Your List's Order Instantly

Check if sorted and get immediate feedback on your list's order. Returns ascending, descending, or unsorted.

Input
Ready
Output
Live

Three-way verdict on list order

Walks the list once, comparing each line to the next with `localeCompare(b, undefined, { numeric: true })` - the same compare used by the default alphabetical sort. Returns one of three strings: `Sorted ascending`, `Sorted descending`, or `Not sorted`.

Distinguishes "genuinely disordered" from "already reverse-sorted" - a plain yes/no check would collapse those two cases. Lines that compare equal (including consecutive duplicates) are compatible with either direction, so a list of identical items reports as Sorted ascending.

Short-circuits on the first pair that breaks the running direction - no full traversal when the answer is already decided. Runs live in your browser with no options to configure.

How to use verify your list's order instantly

  1. 1Enter your list into the input panel
  2. 2Watch the output update automatically
  3. 3Review the result for sorted status
  4. 4Adjust your list if needed
  5. 5Copy the result for your records

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 Check if Sorted does

Walks the list pairwise with `localeCompare(numeric: true)` and returns one of three verdicts.

Three-way verdict, not just yes/no

Returns `Sorted ascending`, `Sorted descending`, or `Not sorted`. Lets you distinguish a list that is already reverse-sorted (often a deliberate order) from one that is genuinely disordered - a plain yes/no check collapses those two cases.

Natural-number aware via localeCompare

Uses `localeCompare(b, undefined, { numeric: true })` so `file2` is treated as less than `file10` - the same comparison that powers the default alphabetical sort. A list sorted with that sort is recognised as sorted by this checker.

Ties do not break the verdict

Consecutive equal items (e.g. `apple`, `apple`) count as compatible with both ascending and descending - the op requires strict violations before declaring "not sorted". A list of identical items is reported as Sorted ascending.

First mismatch decides

Short-circuits on the first pair that breaks the running direction - no full traversal when the answer is already known. Reads the full list only when the list really is monotonic end-to-end.

Runs live in the browser

The verdict updates as you type, no upload. There are no options to configure - the comparison is fixed at `localeCompare(numeric: true)`.

Worked example

One item per line. Op uses `localeCompare` to walk pairs - returns `Sorted ascending`, `Sorted descending`, or `Not sorted`.

Input
1
2
3
4
5
Output
Sorted ascending

Settings reference

How each option changes the output, with the sample above as input.

Setting What it does Effect on the sample
No options available The tool runs with default settings The output reflects the list's sorted status

FAQ

How does the tool determine order?
The tool checks if each item in the list follows the previous item in a specified order. It supports both ascending and descending checks.
How does it handle lists that mix numbers and text?
Every line is compared as a string via `localeCompare` with `numeric: true` - there is no separate numeric mode. In practice that means a list like `[1, 2, apple]` can read as Sorted ascending in many locales (digits sort before letters), but the verdict depends on locale-specific compare rules. For guaranteed number-only results, pre-filter with Filter numbers first.
What happens if the list isn't sorted?
The tool will indicate that the list is not sorted and highlight discrepancies, helping you identify unsorted elements.
What happens with ties (consecutive equal items)?
Ties do not break the verdict - `apple, apple, banana` is Sorted ascending, and `apple, apple` alone is too. Only a strict direction reversal (e.g. descending pair inside an otherwise ascending list) turns the verdict to Not sorted.