Validate a CSV file, then clean it in one step
The CSV validator and formatter checks a CSV file against RFC 4180 — the specification most CSV readers follow — and then writes a cleaned copy in the format you need. Paste the data or load a .csv/.tsv file and the validation report lists every problem with its row and line number: rows with too many or too few fields, unclosed or stray quotes, mixed line endings, blank or duplicate headers, empty rows, trailing delimiters and cells that could run as formulas in Excel.
The formatter fixes what it can. Switch the delimiter (semicolon CSV from European Excel to comma, or CSV to TSV), choose how fields are quoted and which line endings to use, trim stray spaces, drop empty rows and columns, remove duplicate rows, pad short rows and save as UTF-8 with or without a byte order mark. An aligned plain-text preview shows the result as a readable table.
Files are read and cleaned in your browser — nothing is uploaded.
How to use the CSV Formatter & Validator
- Load a file with Load file (or drop it on the input) so line endings and encoding can be checked too — or paste CSV text.
- Read the Validation report. Click a row reference to jump to that line in the input.
- Choose the Output delimiter, Quoting and Line endings.
- Tick the clean-ups you want: trim spaces, remove empty rows or columns, remove duplicates, fix ragged rows, guard formulas, add a UTF-8 BOM.
- Check the Cleaned CSV and the aligned preview, then press Download or Copy.
CSV Formatter & Validator features
Precise row and line numbers
Every problem gives the row number (as a spreadsheet counts it, header = row 1) and the line in the file where that row starts — which differ when a quoted cell contains a line break.
Line ending and encoding checks
Loaded files are inspected byte for byte: CRLF, LF and bare CR endings are counted, BOMs reported and files that are not valid UTF-8 read as Windows-1252 and saved as UTF-8.
Byte-exact output
The download is exactly what the options say — delimiter, quoting, CRLF or LF, and BOM or no BOM — so it is safe to feed to strict importers.
CSV injection warning
Cells beginning with =, +, - or @ are listed, and “Guard formulas” prefixes them with an apostrophe. Ordinary negative numbers like -5 are left alone.
Non-destructive clean-ups
Each clean-up is a separate tick box and the status bar counts what changed: cells trimmed, rows and columns removed, rows padded, formulas guarded.
What the validator checks
| Check | Severity | Why it matters |
|---|---|---|
| Inconsistent column count | Error | Importers either reject the file or shift values into the wrong columns. |
| Unclosed or stray quotes | Error | One missing quote can swallow the rest of the file into a single cell. |
| Mixed or bare-CR line endings | Warning | Produces phantom blank rows or merged rows in some tools. |
| Duplicate or blank headers | Warning | Keys collide when the CSV becomes JSON or a database table. |
| Empty rows, trailing delimiters | Warning | Many loaders stop at a blank line or create an unnamed extra column. |
| Cells starting with = + - @ | Warning | Spreadsheet apps may execute them as formulas (CSV injection). |
| Spaces, BOM, LF endings, duplicates, empty columns | Info | Legal CSV, but worth knowing before an import. |
Quoting options explained
RFC 4180 says fields containing the separator, a double quote or a line break should be enclosed in double quotes, with any quote inside written twice ("") — without the quotes, readers split the field apart. Everything else may be quoted or not:
- Minimal — where needed: the RFC rule, plus fields with spaces at the start or end, so readers that trim unquoted fields keep them.
- None where safe: strictly the RFC minimum — the smallest file.
- All fields: every field in quotes; some legacy systems require it.
- Non-numeric fields: text is quoted and plain numbers like
42or-3.5are not, which tells some importers which columns are numbers.
Semicolons, decimal commas and Excel
Excel saves “CSV” with the list separator of your Windows region. In much of Europe that is a semicolon, because the comma is the decimal separator: Lamp;"1.234,50". To convert a semicolon CSV to comma CSV, set Output delimiter to Comma — values containing commas are quoted automatically, so 1.234,50 stays one cell. For Excel to show ₹, £, € and accented letters correctly when you double-click a UTF-8 file, tick Add UTF-8 BOM.
To browse a large file before cleaning it, open it in the CSV Viewer; to turn the cleaned file into JSON, use CSV to JSON.
CSV Formatter & Validator FAQ
How do I validate a CSV file online?
Load the file into this CSV validator. The report appears immediately with a verdict — valid, valid with warnings, or not valid — and every problem with its row and line number. Loading the file (rather than pasting) also checks line endings and encoding.
Why does my CSV have the wrong number of columns in some rows?
Usually a value contains the delimiter but is not quoted (Desk lamp, LED instead of "Desk lamp, LED"), a quote is unbalanced, or a row has a trailing delimiter. The report names the rows; fix the quoting in the source, or tick “Fix ragged rows” to pad short rows and drop empty trailing fields.
How do I change a CSV from semicolons to commas?
Leave Input delimiter on Auto-detect, set Output delimiter to Comma and download. Quoting is adjusted so cells containing commas stay intact.
What is CSV injection?
A cell such as =HYPERLINK(…) or @SUM(…) is text in the CSV, but Excel or Google Sheets may treat it as a formula when someone opens the file. If the data came from users, tick “Guard formulas” so those cells start with an apostrophe and display as text.
Are spaces around values removed?
Only if “Trim spaces in cells” is ticked (it is by default). RFC 4180 treats spaces as part of the value, so untick it if they are meaningful.
Is my CSV uploaded?
No. Validation and cleaning run in JavaScript in your browser, and the cleaned file is created on your device.