CSV field constraint checker
Check CSV fields against local column rules and download valid records, rejected records and a cell-level issue report.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Define the selected columns as string, integer, decimal or Gregorian date. Check required values, exact enumerations, uniqueness and numeric bounds without changing the source cells.
How to use this tool
- Paste or open a UTF-8 CSV with unique headers, then paste the column-rules JSON into the second input.
- Select the fields and constraints you need. Use string min/max bounds for numeric types and exact string values for enumerations.
- Run the check, inspect record/line/column/code/value issues, then download the report and both record subsets. Fix the source and rerun; columns without rules were not checked.
Supported inputs and limits
One UTF-8 CSV or pasted input, at most 1 MiB, 10,000 data records, 100 columns and 200,000 cells. A selected file takes precedence over pasted input. Rules JSON is limited to 1 MiB and 100 selected fields. Up to 40,000 issues can be reported; larger reports require a smaller input.
CSV needs unique, nonempty headers and consistent row widths. Rules use {"fields":[{"name":"age","type":"integer","required":true,"min":"0"}]}. Types are string/integer/decimal/date; optional constraints are required, unique, enum, min and max. Unknown rules or column names fail. Unselected columns pass through without validation.
Numeric min/max values are JSON strings and compare as exact decimals. Numbers allow at most 100 digits and exponents from -100 to 100. Integer cells use decimal integer notation; surrounding whitespace is trimmed only for numeric/date checks. Dates must be YYYY-MM-DD in Gregorian years 0001–9999.
Blank or whitespace-only optional cells skip constraints. Enumerations and uniqueness compare original nonblank text exactly, including leading zeroes and spaces; every duplicate receives an issue. Record includes the header as record 1; line is the physical start line even when quoted cells contain line breaks.
Downloads include report.json, valid.csv, rejected.csv and issues.csv. The JSON preserves original values; CSV spreadsheet safety defaults to adding an apostrophe before formula-like cells. The page previews 200 issues. Rules never execute code, formulas, regular expressions or database operations.
Worked example
Example input
id,age,date
01,20,2024-02-29
02,-1,2023-02-29
03,,2024-01-01
Column rules (JSON):
{"fields":[{"name":"id","required":true,"unique":true},{"name":"age","type":"integer","required":true,"min":"0"},{"name":"date","type":"date"}]}Example options
{"spreadsheetSafe": true}Example output
{
"records": 3,
"validRecords": 1,
"rejectedRecords": 2,
"issueCount": 3,
"validatedColumns": [
"id",
"age",
"date"
],
"issues": [
{
"record": 3,
"line": 3,
"column": "age",
"code": "min",
"value": "-1"
},
{
"record": 3,
"line": 3,
"column": "date",
"code": "type:date",
"value": "2023-02-29"
},
{
"record": 4,
"line": 4,
"column": "age",
"code": "required",
"value": ""
}
]
}When something does not work
Fix malformed CSV, repeated headers, unknown field names or invalid rules before running. For data issues, inspect the report, correct the original cells, and rerun. Smaller inputs are needed when file, record, cell or issue limits are exceeded.
Frequently asked questions
Does a rejected record disappear?
No. It is retained in rejected.csv, while report.json records every issue and the original cell text. Valid records are delivered separately.
What is the difference between record and line?
Record 1 is the header and each CSV record has one number. A quoted cell may contain several physical lines; line reports the beginning of that record.
Are 01 and 1 considered duplicates?
No. Uniqueness and enumerations use the original exact strings. Numeric validation can accept both as integers, but it does not rewrite identifiers.
Will it validate every column automatically?
No. Only fields named in the rules are checked. Unselected columns are preserved so the rules remain an explicit contract.