CSV Cleaner
Trim stray spaces, drop empty rows and duplicates, and find the rows whose column count is wrong.
Processed on your device — no upload
How to use it
- Paste the messy CSV, or choose a file.
- Turn on the fixes you want.
- Copy or download the cleaned file.
How it works
Five fixes run in a fixed order, and the order matters. Cells are trimmed first, then rows are padded or truncated to the header width, then empty rows are dropped, then duplicates are removed. Deduplicating before trimming would miss every pair that differed only by a trailing space — which is most of them.
Trailing whitespace is the invisible bug. "Sara " and "Sara" look identical and are different to every lookup, join and deduplication that will ever touch the file. This is the single most common reason a “clean” export fails to import.
Ragged rows are reported before they are fixed. A row with too few columns usually means an unescaped delimiter somewhere upstream; one with too many usually means a stray comma inside an unquoted field. The count in the status line tells you whether you are tidying a file or papering over a broken export.
Duplicate detection compares whole rows, case-insensitively, and keeps the first occurrence — so the original order survives and the earliest record wins.
A worked example
Press Load a messy sample. It contains, deliberately, every problem a real export has: a header with a trailing space, a leading space in a value, a blank row, the same customer twice with different capitalisation, a row missing its city, and a row with an extra field.
The status line reads rows in 6, rows out 4, ragged 2. Two rows disappeared: the blank one and the duplicate. Two rows had the wrong column count and were padded or truncated to fit.
The duplicate is worth looking at closely. SARA@example.com with a trailing space and sara@example.com are the same person. Without trimming and case-insensitive comparison they are two records, and the mailing list sends twice.
Turn the column-name option to lowercase-with-underscores and name becomes name. Header names with trailing spaces are a classic import failure: the target system looks for name, finds "name ", and reports that a required column is missing.
Once the file is clean, converting it to JSON or to Excel is straightforward. Clean first — every other tool behaves better on tidy input.
Questions
Does it validate the file as well as clean it?
It reports rows whose column count does not match the header, which is the fault that silently shifts every field after it.
Is my data uploaded?
No. Cleaning runs in your browser, which matters because the files people clean are usually customer or staff records.
Why does trailing whitespace matter if I cannot see it?
Because every lookup, join and deduplication can see it. It is the most common reason two identical-looking rows are treated as different.
What is a ragged row?
A row whose column count does not match the header. Too few usually means an unescaped delimiter upstream; too many usually means a stray comma in an unquoted field.
Which duplicate is kept?
The first. The file is processed top to bottom and the original order is preserved, so the earliest record wins.
Is duplicate matching case sensitive?
No. Rows are compared case-insensitively after trimming, which is what catches the same email address written two different ways.
Should I lowercase my column names?
If the file is going into a database or a script, yes — consistent snake_case names avoid the mismatch that comes from a stray capital or space.
Does it fix broken quoting?
No. If the source file has unescaped quotes the parse itself is wrong, and no amount of tidying afterwards recovers it. Fix the export.
What delimiter does the output use?
A comma, quoting only the fields that need it. Convert to another delimiter afterwards if your target expects one.