All posts
Feature7 min read

Clean Messy CSV Data Online — Describe the Fix, AI Writes the Rule

Excel formula wrappers like ="H4339136200", leading apostrophes, stray currency symbols, doubled quotes, rogue whitespace — the junk that shows up in exported CSVs. csvdiff.app now lets you clean any column by describing the fix in plain English; AI turns it into a reusable find/replace rule you preview before applying. All in your browser, no upload.

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.

Describe the cleanup
remove the ="…" wrapper and the quotes
AI ruleUNWRAPRemoves the leading = and all double quotes.
="H4339136200"H4339136200
="H8891245700"H8891245700
="H1002994411"H1002994411
Preview shown before it applies · rule runs on every row and carries through to export
Describe the fix in plain English; AI writes the rule and previews it on your real values before anything changes.

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

FeatureExcel find & replaceHand-written regexPython / pandasClean 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
SupportedPartial / via pluginNot supported
Cleaning a messy column: the usual options vs describing 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

Frequently asked questions

How do I remove the ="…" wrapper from a CSV column?+

Open the file in the csvdiff.app viewer, click the Clean-with-AI (sparkles) button on that column's header, and type something like "remove the =\"\" wrapper and quotes". AI generates a find/replace rule, shows you a before → after preview (e.g. ="H4339136200" → H4339136200), and applies it to every row once you click Apply. It also carries through when you export.

Does cleaning my CSV upload it anywhere?+

No. The file is parsed and cleaned entirely in your browser tab; there is no server that receives it. The only data that leaves your machine is a small sample — the column name and up to a dozen example values — sent directly from your browser to your own AI key so the model can write the rule. There is no upload endpoint and no account.

Is the AI cleanup reliable and repeatable?+

Yes. The AI is only used once, to turn your plain-English request into a regular-expression find/replace rule. That rule is then applied locally to every cell by the browser — it is deterministic, so the same rule always produces the same result. It is not a per-cell AI call, and the generated rule is plain regex, never executed code.

Can I clean currency or number columns to make them numeric?+

Yes. Describe it as "strip the dollar signs and commas" and the generated rule will turn "$1,234.50" into 1234.50 across the column. You can then apply a Number or Currency display format on top if you want it shown with separators again.

Do I need an API key to use Clean with AI?+

You need a free Gemini or OpenRouter key for the Clean-with-AI step, since that is the part that writes the rule. You set it once in AI settings and it is stored only in your browser. The rest of the viewer and diff — opening files, sorting, filtering, formatting, exporting — needs no key.

Try it yourself

Ready to diff your files?

Upload two CSV files and see the differences in seconds. 100% client-side — your data never leaves the browser.

Start comparing →
100% in your browser

Ready to diff?

Drop your files, see the deltas, export the merge. Takes 30 seconds.