Category Canonicalize

Normalize spelling, case, and whitespace variants in categorical columns using a mapping you control, with suggestions for the values still outside the vocabulary.

Try:
Canonicalized output

About this tool

Category Canonicalize cleans categorical columns when the same value appears under several spellings, abbreviations, capitalization styles, or whitespace variants. Paste a CSV/TSV table or a one-value-per-line list, supply a mapping such as USA|U.S.A.|us => United States, and the tool rewrites only the selected column(s).

Use the suggestions output as a review pass: it lists values not covered by the mapping, how often they occur, and the closest canonical value. Accept the suggestions you trust by adding them to the mapping, then rerun to produce the final table. All matching is deterministic and based on the vocabulary you provide; this is for controlled normalization, not unsupervised clustering.

Worked example

Input data:

country,n
USA,1
u.s.a.,2
Canadaa,3
Brazil,4

Mapping:

USA|U.S.A.|us|united states => United States
Canada|CAN => Canada

With column = country, header = true, and output = csv, the USA variants become United States, canonical Canada stays canonical, and uncovered Canadaa/Brazil remain available for review or fuzzy handling.

Limits and edge cases

FAQ

Can it discover clusters without a mapping?

No. This tool applies a supplied vocabulary and suggests the nearest supplied canonical for uncovered values. Use it when you already know the allowed labels and want an auditable cleanup pass.

How do I review fuzzy matches before changing the table?

Choose the suggestions output. It returns a CSV with each uncovered value, its count, the nearest canonical, and the similarity score. Add accepted rows to your mapping and rerun, or switch unmatched values to fuzzy once the threshold is conservative enough.

What mapping separators are accepted?

Use =>, ->, =, a tab, a comma, or a semicolon between variants and canonical values. Use | to list several variants for the same canonical, for example NY|N.Y.|new york => New York.

What happens to values not covered by the mapping?

Pick the policy that fits your workflow: keep originals, blank them, stop with an error, or apply the closest fuzzy suggestion when it reaches the threshold.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool category-canonicalize "country,n
USA,1
u.s.a.,2
Canadaa,3
Brazil,4" 'mapping=USA|U.S.A.|us|united states => United States
Canada|CAN => Canada'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/category-canonicalize/?data=country%2Cn%0AUSA%2C1%0Au.s.a.%2C2%0ACanadaa%2C3%0ABrazil%2C4&mapping=USA%7CU.S.A.%7Cus%7Cunited%20states%20%3D%3E%20United%20States%0ACanada%7CCAN%20%3D%3E%20Canada&column=country&delimiter=auto&header=true&ignore_case=true&ignore_spacing=true&unmatched=keep&fuzzy_threshold=85&output=csv

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.