RFC 4180 Quoted Field Parser Check
Check RFC 4180 field quoting with explicit Unicode and CR/LF extensions; blank records are retained, and field-width consistency is checked separately.
Description
CSV quoting allows delimiters and line breaks inside a field by enclosing that field in double quotes and doubling any interior quote.
CSV quoting allows delimiters and line breaks inside a field by enclosing that field in double quotes and doubling any interior quote. Checking this structure before import helps distinguish a malformed record from an ordinary empty value.1, 2
Check RFC 4180 field quoting with explicit Unicode and CR/LF extensions; blank records are retained, and field-width consistency is checked separately.
When to use RFC 4180 Quoted Field Parser Check
Use this tool to check RFC 4180 field quoting with explicit Unicode and CR/LF extensions; blank records are retained, and field-width consistency is checked separately.
Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.
How to use RFC 4180 Quoted Field Parser Check and understand its results
- Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.
- Enter csv, delimiter using the field table and calculation rules, then run the tool.
- Read valid, recordCount, fieldCount, errorOffset, errorCode. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| csv | CSV text | string; maximum length: 100000 | Required |
| delimiter | Delimiter | string; one of ,, ;, | Required |
Paste complete CSV text and choose comma, semicolon or tab. The state machine tracks field starts, unquoted fields, quoted fields and closing quotes. It accepts doubled quotes inside quoted fields and requires a delimiter or record ending after a closing quote. Valid results give the total records and fields, errorOffset −1 and an empty errorCode. A syntax failure returns valid false, zero counts, invalid_csv and a zero-based UTF-16 error offset. Empty text is valid with zero records; a terminal record ending does not add a record.
valid = parser reaches end with no unfinished quote or invalid post-quote text Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| valid | Valid | boolean |
| recordCount | Record count | integer; minimum: 0; maximum: 9007199254740991 |
| fieldCount | Field count | integer; minimum: 0; maximum: 9007199254740991 |
| errorOffset | Error offset | integer; minimum: -1; maximum: 9007199254740991 |
| errorCode | Error code | string |
{
"input": {
"csv": "name,note\r\nAda,\"a,b\r\nc\"",
"delimiter": ","
},
"output": {
"valid": true,
"recordCount": 2,
"fieldCount": 4,
"errorOffset": -1,
"errorCode": ""
}
} Limitations and assumptions
The parser accepts Unicode, semicolon/tab delimiters and CR, LF or CRLF endings beyond the strict RFC profile. It does not require equal field counts or interpret headers and cell types. Text/field resource limits are input errors, distinct from a returned syntax failure; at most 10,000 fields are parsed.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.
Alternative or Complementary methods
Use Doubled-Quote Escape Validator: Validate one double-quoted CSV field token, accepting interior quotes only in doubled pairs; this does not validate an entire CSV document. For a complementary task, use Column Drop By Index: Drop selected zero-based columns from a rectangular CSV, preserving all remaining cells and rejecting removal of every column.
Further background: RFC 4180: CSV quoting and record format.
References
-
RFC 4180 Quoted Field Parser Check — tool.io
-
RFC 4180: CSV quoting and record format — RFC Editor
Similar or alternative tools
- Doubled-Quote Escape Validator
Validate one double-quoted CSV field token, accepting interior quotes only in doubled pairs; this does not validate an entire CSV document.
- Column Drop By Index
Drop selected zero-based columns from a rectangular CSV, preserving all remaining cells and rejecting removal of every column.