# Sorted Order Checker

Check whether a list of numbers is sorted ascending or descending and see exactly where the order first breaks. Free, runs in your browser.

## Run it

- **CLI:** `gizza tool sorted-order-checker "1, 4, 9, 2, 7"`
- **Web:** https://gizza.ai/tools/sorted-order-checker/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/sorted-order-checker/tool.json

## Inputs

- `numbers` — Numbers _(field)_
- `order` — Order to verify _(field)_
- `strict` — Strict — repeated values count as out of order _(field)_
- `separator` — Value separator _(field)_
- `strip_thousands` — Treat , and _ inside a value as thousands separators _(field)_
- `non_numeric` — Non-numeric entries _(field)_
- `max_issues` — Out-of-order elements to list (1-1000) _(field)_
- `format` — Output format _(field)_

## Output

- Order report (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `numbers` — Numbers
- `order` — Order to verify
- `strict` — Strict — repeated values count as out of order
- `separator` — Value separator
- `strip_thousands` — Treat , and _ inside a value as thousands separators
- `non_numeric` — Non-numeric entries
- `max_issues` — Out-of-order elements to list (1-1000)
- `format` — Output format

Example: `https://gizza.ai/tools/sorted-order-checker/?numbers=1%2C%204%2C%209%2C%202%2C%207&order=auto&strict=true&separator=auto&strip_thousands=true&non_numeric=error&max_issues=20&format=text`

---

## About this tool

Sorted Order Checker verifies numeric sequences without changing the data. Paste comma-separated, newline-separated, space-separated, tab-separated, semicolon-separated, or pipe-separated values and the tool reports whether the list is sorted ascending, descending, or in the direction it auto-detects from the first differing pair.

The report is designed for debugging spreadsheets, generated IDs, timestamps, ranking exports, sensor readings, and batch jobs where one misplaced value can break a pipeline. When the list is not sorted, it names the first out-of-order element with its 1-based position, value, previous neighbour, and the comparison that failed. It also reports the total number of broken neighbour comparisons and the longest already-sorted run.

### Worked example

Input:

```text
1, 4, 9, 2, 7
```

With `order=auto`, `strict=false`, and `separator=auto`, the report starts:

```text
Not sorted ascending (equal neighbours allowed) — the order first breaks at position 4.
First out-of-order element: position 4, value 2 (previous position 3, value 9)
```

Use `strict=true` when repeated values should fail, such as a unique timestamp or sequence-number check. Use `strip_thousands=true` with an explicit separator (for example `space`) when values contain digit-group separators like `1,024 2,048 4,096`.

### Limits and edge cases

- Accepts up to 20,000 numeric values per run.
- Numbers may be integers, decimals, negatives, leading `+`, or scientific notation such as `1e6`.
- Blank entries are skipped.
- `NaN` and non-numeric tokens are errors by default; set `non_numeric=ignore` to skip header words or placeholders and report how many were ignored.
- `auto` direction treats an all-equal list as constant when ties are allowed; with `strict=true`, repeated neighbours are reported as breaks.
- `max_issues` controls how many broken comparisons are listed; totals still count every break.

## FAQ

<details>
<summary>What does “auto” order do?</summary>

`auto` looks for the first pair of values that are different. If the second is larger, the list is checked as ascending; if it is smaller, the list is checked as descending. This is useful when you only care whether the list is monotonic in either direction.

</details>

<details>
<summary>How is strict mode different from the default?</summary>

By default, equal neighbours are allowed, so `1, 2, 2, 5` is sorted ascending. With `strict=true`, every step must change in the chosen direction, so the repeated `2` is reported as an out-of-order value.

</details>

<details>
<summary>Can I paste values with thousands separators?</summary>

Yes. Set `strip_thousands=true` and choose a separator that is not a comma, such as `space` or `newline`. For example, `1,024 2,048 4,096` with `separator=space` parses as three values.

</details>

<details>
<summary>What happens if my list has headers or `n/a` entries?</summary>

The default `non_numeric=error` stops and names the first bad token so you can fix the data. If the labels are expected, set `non_numeric=ignore`; the tool skips those tokens, checks the numeric values that remain, and reports how many were ignored.

</details>

## Related tools

- [Absolute value, sign, or negation for a whole column](https://gizza.ai/tools/absolute-value-transformer/): Paste a column of numbers and apply absolute value, sign extraction (-1/0/1), sign flipping, or force-negative to every value at once, with rounding and an audit table.
- [Adjacency Matrix Converter](https://gizza.ai/tools/adjacency-matrix-converter/): Convert a graph between edge list, adjacency matrix, and incidence matrix — directed or undirected, weighted or not. Free, private, runs in your browser.
- [Amazon Order Analyzer](https://gizza.ai/tools/amazon-order-analyzer/): Paste an Amazon order-history CSV export to summarize total spend by month, top items, and category breakdowns. Browser-only, private, with Markdown or JSON output.
- [ARFF Converter](https://gizza.ai/tools/arff-converter/): Convert Weka ARFF datasets to CSV and CSV tables back to ARFF locally — nominal attributes, numeric types, dates, sparse rows, missing values, and type rows.
- [Avro to JSON Converter](https://gizza.ai/tools/avro-to-json/): Decode Apache Avro Object Container Files (.avro / OCF) to JSON, NDJSON, or the embedded schema — no .avsc needed, free and private in your browser.
