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
- 1Enter your list into the input panel
- 2Watch the output update automatically
- 3Review the result for sorted status
- 4Adjust your list if needed
- 5Copy the result for your records
Keyboard shortcuts
Drive ListShift without touching the mouse.
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`.
1 2 3 4 5
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 |