Clean a CSV: Remove Duplicates, Blanks & Extra Spaces

Drop your file below to strip out duplicate rows, empty rows, stray leading/trailing spaces, and columns with no data in them — your header stays put, and nothing is uploaded. Preview before and after, then download.

Quick Answer: CSVUndo cleans messy CSV files by removing duplicate rows, blank lines, empty columns, and leading/trailing whitespace locally in your browser. All file transformations execute client-side with an enforced connect-src 'none' CSP, ensuring zero data egress or third-party storage.

Drop your CSV file here or click to choose a file — it opens in your browser tab, never on a server
…or paste the data straight into the box below

No file to hand? Grab sample-duplicate-rows.csv — duplicate and blank rows — and drop it above. All samples.

What to clean
Output options for the cleaned file

Excel-safe wraps long numbers and zero-led codes as ="00501", so Excel reads them as text and cannot re-damage them when the file is reopened. Leave it off if the file goes straight into another system, which may show the = literally.

🔒 Try it: switch off your Wi-Fi — the clean-up still runs, because your file never leaves this tab. We can't read, store, or leak what we never receive. Prove it in 30 seconds →

What the cleaner does

This tool tidies the structure of a CSV without touching the meaning of your data. It handles the four housekeeping jobs that clutter exported files — each is optional, and you can run any combination in a single pass:

What each cleaning option removes
OptionWhat it removes
Remove duplicate rowsLater exact copies of a row (the first is kept). Optionally case-insensitive.
Trim extra spacesLeading and trailing spaces in every cell ( London London).
Remove blank rowsRows where every cell is empty — the gaps a paste or merge leaves behind.
Remove empty columnsColumns with no data in any row. The header name is dropped with the column.

Your header row is always preserved and never treated as a duplicate. If your file has no header, untick “First row is a header” and every row is treated as data.

When you’d use it

Exports pick up cruft fast. Two systems merged into one list leave duplicate contacts; a copy-paste from a web page adds trailing spaces that make "London " and "London" look different to every downstream tool; an append job leaves blank separator rows; a template leaves a run of empty columns on the right. A quick clean before you import into a CRM, a mailing tool, or a database saves the “why are there 12,000 rows when I have 9,000 contacts” conversation later.

Is it safe? What it will and won’t change

The cleaner only does what you tick, and it runs entirely in your browser. It never edits the values inside your cells beyond trimming outer spaces, and it never uploads anything — you can disconnect from the internet after the page loads and it keeps working. The before/after preview and the removal counts let you confirm exactly what changed.

One honest note: “duplicate” means an exact row match (after trimming/case options). If two rows describe the same customer but differ by one character — a middle initial, a different phone — they are not duplicates and are both kept, by design. Fuzzy matching would risk deleting real records, so we don’t guess.
Was the file also damaged by Excel?

Cleaning removes clutter but doesn’t undo Excel’s type-guessing. If numbers are stuck in 1.23E+12 notation or ZIP codes lost their zeros, repair that first, then clean.

Open the CSV repair tool →

Related

Need to change the separator instead of cleaning? Use the CSV ⇆ TSV converter. For a full walk-through of de-duplicating a CSV (including the Excel and Google Sheets ways to do it), see how to remove duplicate rows from a CSV. If cells look trimmed but lookups still fail, the culprit is usually the non-breaking space TRIM can’t remove; and if your row count looks wrong, check for line breaks hiding inside cells. Or browse all guides.

Frequently asked questions

How do I remove duplicate rows from a CSV?

Drop the file into the cleaner above, tick Remove duplicate rows, and click Clean & Download. The first occurrence of each row is kept and later exact copies are dropped; the header is preserved. Tick Ignore case so Apple and apple count as the same.

Will the cleaner change my data or is it safe?

It only does what you tick — remove duplicate rows, drop blank rows, trim spaces, or delete columns with no data in them. It never alters the values inside cells beyond trimming outer spaces, and it runs entirely in your browser, so the file is never uploaded.

Does it keep the header row?

Yes. The first row is treated as a header and is never removed or de-duplicated. If your file has no header, untick First row is a header and every row is treated as data.

Can it remove blank rows and extra spaces at the same time?

Yes — tick any combination and they run together in one pass. The summary afterwards tells you exactly how many duplicate rows, blank rows, and empty columns were removed and how many cells were trimmed.