CSV Validator
Find what will break a CSV import, with line numbers: ragged rows, unclosed or stray quotes, duplicate headers, mixed line endings, a BOM, mojibake and formula-style cells. It runs in your browser.
Paste a CSV and get every fault that corrupts an import, with the physical line it is on. The delimiter is detected from the first record unless you pick one.
What the validator catches
Each report below came from this page's validator when the site was built. The last two cases are deliberately clean: a validator that flags legal CSV is as unhelpful as one that misses broken CSV.
A short row
The most common import failure. The line number is the physical line in the file.
CSV
a,b,c 1,2,3 4,5
What the validator reports
- ERROR line 3: Has 2 field(s); the header has 3.
A quote that never closes
Everything after the open quote is swallowed into one field, which is why such files seem to lose rows.
CSV
a,b 1,"unclosed 2,3
What the validator reports
- ERROR line 2: Quoted field opened here is never closed. Everything after it is being read as one field.
A stray quote in an unquoted field
Lenient parsers keep it; strict ones reject the row.
CSV
a,b 1,x"y
What the validator reports
- WARNING line 2: Quote character inside an unquoted field. Strict parsers reject this; wrap the field in quotes and double the inner quotes.
A duplicate column name
Most importers keep one of the two values without telling you.
CSV
id,name,id 1,a,2
What the validator reports
- WARNING line 1: Duplicate column name "id". Importers keep one value and drop the others.
Mixed line endings
Usually the sign of a file edited on two systems.
CSV
a,b\r\n 1,2 3,4\r\n
What the validator reports
- WARNING: Mixed line endings (2 CRLF, 1 LF, 0 lone CR). Some tools see this as extra blank rows or as one long line.
A byte order mark
Excel wants it to detect UTF-8; many parsers read it as part of the first column name.
CSV
<BOM>a,b 1,2
What the validator reports
- WARNING line 1: File starts with a UTF-8 byte order mark. Excel needs it; most parsers return it as part of the first column name.
Mojibake
é where é should be means UTF-8 bytes were decoded as Windows-1252 somewhere upstream.
CSV
name José
What the validator reports
- WARNING: Looks like UTF-8 text that was decoded as Windows-1252 (e.g. "é" for "é").
A formula-style cell
A cell starting with = can run as a formula when the file is opened in a spreadsheet (CSV injection).
CSV
a,b =cmd,2
What the validator reports
- WARNING line 2: Cell "=cmd" starts with a formula character; Excel and Sheets may evaluate it.
A quoted field across two lines
Legal CSV, so nothing is reported, even though the record spans two physical lines.
CSV
a,b 1,"multi line" 2,3
What the validator reports: nothing
A semicolon-separated file
Not reported: semicolon files are common where the comma is the decimal separator, and the validator reads the delimiter from the file.
CSV
a;b 1;2
What the validator reports: nothing