CSV Cleaner

Trim whitespace, fix encodings, and normalize line endings in CSV files

Ad placeholder (leaderboard)

Clean up a messy CSV export

The CSV Cleaner fixes the small inconsistencies that break CSV imports: invisible byte-order marks, mixed line endings, stray whitespace around values, and blank rows. It parses your file with a quote-aware reader, applies the fixes you choose, and re-emits clean, normalized CSV with a before/after summary.

How it works

First, if BOM removal is on and the file begins with U+FEFF, that character is stripped. The cleaner counts CRLF (\r\n) sequences in the raw text so it can report how many line endings are normalized — the output is always written with LF. The text is then parsed into rows and cells with a parser that respects double-quoted fields and escaped quotes.

Each cell is optionally trimmed of leading and trailing whitespace, and runs of two or more spaces or tabs can be collapsed to a single space. Fully empty rows are dropped when that option is enabled. Finally each field is re-serialised and quoted only when it contains a comma, double quote, or newline, following RFC 4180 minimal-quoting rules.

Tips and notes

Run the cleaner before importing into a database or spreadsheet that matches on exact header names — a lingering BOM is the most common cause of a “column not found” error on the very first field. Cell trimming is safe for most data, but leave it off if leading or trailing spaces are meaningful in your dataset (for example fixed-format reference codes). The summary’s counts let you confirm the tool changed exactly what you expected before you download.

Ad placeholder (rectangle)