# Clean messy number cells into floats

Strip currency symbols, thousands separators, units, percents, and stray whitespace from messy spreadsheet number cells and parse them into clean floats.

## Run it

- **CLI:** `gizza tool numeric-string-sanitizer "\$1,234.50 USD
(250.00)
1.2K
45.2%
CHF 1'234'567.89"`
- **Web:** https://gizza.ai/tools/numeric-string-sanitizer/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/numeric-string-sanitizer/tool.json

## Inputs

- `input` — Numbers to clean _(field)_
- `decimal_separator` — Decimal separator _(field)_
- `percent` — Percent signs _(field)_
- `magnitude_suffixes` — Expand K/M/B/T suffixes _(field)_
- `parentheses_negative` — Accounting parentheses are negative _(field)_
- `decimals` — Round decimals _(field)_
- `on_error` — Rows that cannot be parsed _(field)_
- `output` — Output format _(field)_
- `stats` — Append summary stats _(field)_

## Output

- Cleaned numbers (text)

## Query parameters

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

- `input` — Numbers to clean
- `decimal_separator` — Decimal separator
- `percent` — Percent signs
- `magnitude_suffixes` — Expand K/M/B/T suffixes
- `parentheses_negative` — Accounting parentheses are negative
- `decimals` — Round decimals
- `on_error` — Rows that cannot be parsed
- `output` — Output format
- `stats` — Append summary stats

Example: `https://gizza.ai/tools/numeric-string-sanitizer/?input=%241%2C234.50%20USD%0A%28250.00%29%0A1.2K%0A45.2%25%0ACHF%201%27234%27567.89&decimal_separator=auto&percent=strip&magnitude_suffixes=true&parentheses_negative=true&decimals=auto&on_error=blank&output=values&stats=true`

---

## Clean spreadsheet numbers without guessing by hand

Exports from accounting systems, dashboards, PDFs and vendor spreadsheets often look numeric to a human but are text to a machine: `$1,234.50 USD`, `1 234,56`, `(250.00)`, `45.2%`, `1.2K`, or values with non-breaking spaces pasted from the web. Paste a column here and get back plain floats that sort, sum and import cleanly.

The sanitizer works one row per line. It strips currency symbols, thousands separators, common units, Unicode whitespace, accounting parentheses, trailing minus signs and optional K/M/B/T finance suffixes. In `auto` mode it infers one decimal convention for the whole column so European and US formats are handled consistently.

**Worked example:** paste this messy column:

```text
$1,234.50 USD
(250.00)
1.2K
45.2%
```

With defaults you get:

```text
1234.5
-250
1200
45.2
```

Choose **Percent signs → Divide by 100** when you need `45.2%` as `0.452` for calculations, or **Output format → Audit table** when you want to keep each original value next to its parsed result and status.

### Options

- **Decimal separator** — `auto` infers dot vs comma for the whole column; force `dot` for `1,234.56` or `comma` for `1.234,56`.
- **Percent signs** — strip the percent sign or divide the value by 100.
- **Expand K/M/B/T suffixes** — `1.2K`, `3M`, `2bn`, and `1T` become full numbers; ordinary units like `kg` are stripped without scaling.
- **Accounting parentheses are negative** — `(250.00)` becomes `-250`.
- **Round decimals** — keep full precision or round to a fixed number of places.
- **Rows that cannot be parsed** — emit blank lines, keep the original text, write `#ERROR`, or fail immediately.
- **Output format** — values only, TSV audit table, or JSON with row statuses and totals.
- **Append summary stats** — add count, parsed/failed/empty, sum, min, max and average.

### Notes and limits

- Maximum input is 20,000 rows per run.
- Output is always a dot-decimal numeric string; grouping separators are never emitted.
- Empty middle rows stay aligned with the source. Trailing blank lines are ignored.
- Values too large for a 64-bit float are rejected.
- Auto decimal detection assumes the column uses one convention. If your data mixes `1,234.56` and `1.234,56`, force the intended convention or split the column first.

## FAQ

<details>
<summary>Will this change my decimal comma data into dot decimals?</summary>

Yes. The output is meant for software pipelines and always uses dot decimals, so `1.234,56` becomes `1234.56`. Use the decimal separator option if auto-detection does not match your source convention.

</details>

<details>
<summary>What happens to rows like `n/a` or `—`?</summary>

That depends on the error policy. The default leaves a blank output row so spreadsheet alignment is preserved. You can instead keep the original text, emit `#ERROR`, or fail the whole run on the first bad row.

</details>

<details>
<summary>Does `45%` become `45` or `0.45`?</summary>

By default it becomes `45`, because many cleanup tasks only need the percent sign removed. Switch **Percent signs** to **Divide by 100** when you need fractional values for formulas or model features.

</details>

<details>
<summary>Are units like `kg`, `ms`, or `USD` multiplied?</summary>

No. Ordinary units and currency codes are stripped. Only common finance magnitude suffixes are expanded when that option is on: `K`, `M`, `B`/`bn`, and `T`/`tn`.

</details>

<details>
<summary>Can I audit which rows failed?</summary>

Yes. Choose the TSV audit table or JSON output. Both include each original row, the parsed value when available, and an error status for rows that could not be parsed.

</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.
