How to use the csv validator
- Paste your CSV text into the input area.
- Select the correct delimiter if your file uses semicolons, tabs or pipes instead of commas.
- Toggle First row is header if your data includes column names.
- Review the validation report below for any syntax errors, ragged rows or warnings.
How the csv validator parses data
The parser reads the input character by character following RFC 4180 rules adapted for custom delimiters. When it encounters a double quote at the start of a field, it enters quoted mode. Inside quoted mode, delimiters and line breaks are treated as literal characters rather than structural boundaries. Two consecutive double quotes inside a quoted field are interpreted as a single escaped quote.
For example, given the row "Smith, Jr.""",30 with a comma delimiter, the parser produces two fields: Smith, Jr." and 30. If a quote appears in an unquoted field or a non-quote character follows a closing quote before the delimiter, the parser flags an error at that exact position.
What counts as valid CSV
RFC 4180 defines several rules for well-formed CSV files. Every record should contain the same number of fields across all rows. Fields containing the delimiter character, double quotes or line breaks must be enclosed in double quotes. A double quote inside a quoted field must be escaped by preceding it with another double quote.
This csv validator enforces those rules strictly. It also accepts CRLF and LF line endings interchangeably, since many systems generate one or the other. Trailing empty lines are ignored, matching common editor behavior.
Understanding ragged rows
A ragged row occurs when a record has more or fewer fields than the expected column count. The expected count is determined by the first row (or the header row if that option is enabled). Ragged rows break most downstream parsers and database imports.
| Row content | Fields | Status |
|---|---|---|
a,b,c | 3 | Sets expected count |
1,2,3 | 3 | Valid |
4,5 | 2 | Ragged (too few) |
6,7,8,9 | 4 | Ragged (too many) |
The validator reports each ragged row individually so you can locate and fix the source data precisely.
Delimiters beyond the comma
Although CSV stands for comma-separated values, many real-world datasets use semicolons, tabs or pipes as delimiters. European locales frequently use semicolons because the comma serves as the decimal separator. Tab-separated values avoid conflicts with commas in text entirely.
Select the appropriate delimiter in this tool before validating. If you need to convert between delimiter styles after fixing errors, tools like csv to tsv or tsv to csv handle that transformation.
Common CSV mistakes caught by validation
- Unescaped quotes: Writing
He said "hello"without wrapping the field in quotes or doubling the inner quotes. - Mixed delimiters: Accidentally combining commas and semicolons in the same file.
- Trailing delimiters: Ending every line with a delimiter creates an extra empty field per row.
- Missing quotes around newlines: An unquoted field containing a line break splits the record prematurely.
Catching these issues early prevents failures when importing data into databases or converting to formats like JSON or XML.
Worked examples
| Example | Input | Result |
|---|---|---|
| Well-formed CSV | CSV data: name,age,city / Alice,30,"New York" / Bob,25,London; Delimiter: ,; First row is header: yes | Status: Valid CSV; Total rows: 3; Expected columns: 3 |
| Ragged rows | CSV data: a,b,c / 1,2 / 3,4,5,6; Delimiter: ,; First row is header: yes | Status: Errors found; Total rows: 3; Expected columns: 3; Ragged rows: 2; First error: Ragged row: Row 2 (line 2) has 2 fields, expected 3. |
| Embedded commas and newlines | CSV data: "hello, world","line1 / line2"; Delimiter: ,; First row is header: no | Status: Valid CSV; Total rows: 1; Expected columns: 2; Warnings: 1 |
| Semicolon delimiter | CSV data: col1;col2 / val1;val2; Delimiter: ;; First row is header: yes | Status: Valid CSV; Total rows: 2; Expected columns: 2 |
FAQ
What standard does this csv validator follow?
It implements the parsing rules defined in RFC 4180, which is the widely accepted specification for CSV formatting. It extends the standard by supporting custom delimiters beyond the comma.
Can I validate tab-separated or semicolon-separated files?
Yes. Use the delimiter dropdown to select tab, semicolon or pipe before pasting your data. The parser applies the same quoting and escaping rules regardless of the chosen delimiter.
Is my data sent to a server for validation?
No. The entire parsing and validation process runs locally in your browser using JavaScript. Nothing leaves your machine.
What does a ragged row mean?
A ragged row has a different number of fields than the header or the first row. This usually indicates missing data, an extra delimiter or an unclosed quoted field on a previous line.
How do I fix unescaped quotes in my CSV?
Wrap the entire field in double quotes and replace each internal double quote with two consecutive double quotes. For example, change 5" screen to "5"" screen".
Does the validator handle multiline fields?
Yes. Line breaks inside properly quoted fields are parsed as part of the field value, exactly as RFC 4180 specifies. Unquoted line breaks will split the row and likely trigger a ragged row warning.