Open a CSV exported from a spreadsheet, a database admin tool, or some legacy system, and you have probably seen a column that looks wrong in a way that is hard to fix in bulk. An account number shows up as ="H4339136200" instead of H4339136200, because Excel wrapped it in a formula-text prefix to stop it being reformatted. A ZIP code arrives as '02139 with a leading apostrophe. A price column is full of "$1,234.50" strings you cannot sum. Some cells have doubled "" quotes, others have trailing spaces you cannot see. Fixing one cell is trivial; fixing ten thousand of them consistently is the whole afternoon.
Short answer: open your file in the csvdiff.app viewer, click the Clean-with-AI button on the column header, and describe the cleanup in plain English — "remove the =\"\" wrapper and quotes", "strip the dollar signs and commas", "trim extra spaces". AI turns your request into a find/replace rule, shows you a before → after preview on your real values, and applies it to every cell once you approve. The rule is reusable and carries through to export. The request runs directly from your browser to your own AI key — no upload, no account, no server.
The Kind of Mess This Fixes
Most CSV mess is not corrupt data — it is correct data wearing a costume added by whatever tool exported it. The value H4339136200 is fine; the ="H4339136200" wrapper around it is an Excel artifact meant to preserve leading zeros and long numbers as text. The problem is that the costume travels with the file, so the next tool that reads it sees =" and " as part of the value. The same is true of leading apostrophes, non-breaking spaces, smart quotes, and thousands separators. What you want is a way to strip the costume off every row at once, without hand-writing a regular expression.
- –Excel formula-text wrappers — ="H4339136200" becomes H4339136200
- –Leading apostrophes on text-forced numbers — '02139 becomes 02139
- –Currency symbols and thousands separators — $1,234.50 becomes 1234.50 so the column is numeric again
- –Doubled quotes and stray quote characters left over from nested CSV escaping
- –Whitespace — trim leading and trailing spaces, collapse runs of spaces, convert non-breaking spaces
- –HTML tags and entities that leaked in from a CMS or scraped source
How Clean With AI Works
In the viewer or the diff, every column header has a Clean-with-AI button — the sparkles icon, right after the sort control. Click it and you get a small panel scoped to that one column. The first time you open it, a short walkthrough shows a few example cleanups with their before → after result, so you can see the shape of what to ask for. After that, it is just a text box: describe the change you want in plain words.
When you hit Generate, your request plus a handful of sample values from that column go to your chosen AI model, which returns an ordered list of find/replace rules. Crucially, it does not touch your column yet. You see a before → after preview built from your real values first — so you can confirm ="H4339136200" really does become H4339136200, and that nothing else got caught in the net. Only when you click Apply does the rule take effect across every cell. If the result is not what you wanted, you refine the wording and regenerate, or discard it entirely.
The rule the AI produces is plain regular-expression find/replace — never generated code. csvdiff.app runs those patterns directly; nothing is ever eval'd in your browser. That is what makes the cleanup deterministic and safe: the same rule applied to the same value always produces the same result, and there is no arbitrary script executing on your data.
Deterministic and Reusable, Not a Per-Cell AI Call
A common worry with "AI data cleaning" is that it sends every cell to a model and hopes for consistency — slow, expensive, and impossible to audit. That is not what happens here. The AI is used once, to translate your English request into a find/replace rule. That rule is then applied locally to all your rows by the browser, the same way a number or date format is. Ten rows or a million, it is the same instant transform, and you can read exactly what it does. Once applied, the rule sticks to the column and flows through to your exported CSV or JSON, so the cleaned values are what you download.
Clean With AI vs Doing It By Hand
| Feature | Excel find & replace | Hand-written regex | Python / pandas | Clean with AI |
|---|---|---|---|---|
| No coding required | ||||
| Handles ="…" wrappers cleanly | ||||
| Preview before it changes data | ||||
| Reusable rule that persists | ||||
| Runs in the browser, no upload | ||||
| Describe the fix in plain English |
Your Data Stays in the Browser
Cleaning happens under the same privacy model as the rest of csvdiff.app. Your file is parsed and transformed entirely in your browser tab — there is no server that ever receives it. The only thing that leaves your machine is the small sample the AI needs to write the rule: the column name and up to a dozen example cell values, sent directly from your browser to your own Gemini or OpenRouter key. We never see it, because there is no we in the loop — no upload endpoint, no account, no stored copy. If a column holds genuinely sensitive values you would rather not sample to any model, you can skip the AI and the rest of the tool still works entirely offline.
You bring your own API key, which you can get free from Google AI Studio or OpenRouter, and set it once in AI settings. The key is stored only in your browser and is used for the optional AI features — the plain-English diff summary, the match-key suggestion, and now Clean with AI. Everything else in the viewer and diff runs with no key at all.
Drop a messy CSV into the viewer, click the sparkles button on a column, and describe the fix. See the before → after before anything changes.
Open the CSV viewer →