How to Use the CSV Validator: Step-by-Step Tutorial
The CSV Validator runs entirely in your browser โ no file is uploaded to any server, no account is required, and no data leaves your machine. This tutorial walks through every step of using the tool: loading a file, reading the results panel, understanding each type of issue reported, and fixing the most common problems.
Follow along with the tool open: Open the CSV Validator in a second tab, then work through each step below.
Open CSV Validator โTable of Contents
Step 1 โ Open the Tool
Navigate to /developer-tools/csv-validator/. The tool loads entirely in the browser. There are no cookies set, no account required, and no network requests made after the initial page load. You can confirm this by checking the browser's Network tab in DevTools โ after the page loads, validating a file generates zero outbound requests.
The tool is accessible from the Developer Tools hub, the command palette (press Ctrl+K or โK and type "CSV Validator"), or directly via the URL above.
Step 2 โ Load Your CSV File
There are two ways to get your data into the validator:
Option A โ Drag and drop. Drag your .csv or .tsv file from your file manager and drop it anywhere on the page. A drop zone indicator appears when you drag a file over the browser window. Release to load. The file is read directly from disk by the browser's FileReader API and never leaves your machine.
Option B โ Paste text. Click inside the input text area and paste your CSV content directly. This works well for small files and for validating CSV output copied from a terminal, database query result, or API response. There is no size limit on paste, though very large pastes may take a moment to process.
Once the file or text is loaded, validation runs automatically โ you do not need to click a button. Results appear within a second for most files up to several megabytes.
Step 3 โ Read the Summary Panel
After validation runs, the summary panel shows the top-level properties of your file:
- Delimiter. The character identified as the field separator โ comma, tab, semicolon, pipe, or other. If the detected delimiter looks wrong, it is a signal that the file may use an unusual separator or that quoting has collapsed the field structure.
- Encoding. The detected character encoding โ typically UTF-8, UTF-8 with BOM, or Latin-1. If encoding detection is uncertain, the validator will note this.
- Row count. The total number of rows in the file including the header row (if present). A discrepancy between the row count reported here and what you expect is worth investigating.
- Column count. The column count as determined by the header row or the first data row. If subsequent rows have a different count, that is reported as an error in the issues list.
- Status. A green "Valid" badge means no errors were detected (warnings may still be present). A red "Invalid" badge means one or more errors were found that would likely cause a parser to fail or produce incorrect output.
Step 4 โ Review the Issues List
Below the summary, the issues list shows each detected problem. Each issue entry contains:
- Severity. Error (red) or Warning (yellow). Errors indicate structural problems that will likely cause a parser to fail. Warnings indicate problems that may or may not cause issues depending on the target parser โ blank header names, BOM presence, and trailing whitespace in headers are common warnings.
- Row number. The 1-based row number where the issue was detected. Click to scroll the preview panel to that row.
- Description. A plain-English description of what was found and why it is a problem.
If the issues list is empty and the status badge is green, the file passed all checks. An empty issues list with a yellow warning badge means warnings were found but no structural errors.
Step 5 โ Understand Each Issue Type
The CSV Validator reports the following issue types. Here is what each means and how to fix it:
Column count mismatch
Example message: "Row 14 has 5 columns; expected 6."
The row at the specified line number has a different number of fields than the header row (or the first row if no header). This is the most common CSV error. Causes: an unquoted field containing the delimiter, a missing field, or a spurious extra delimiter at the end of a row. To fix: open the file in a text editor, navigate to the specified row, and look for unquoted commas inside field values or a missing/extra field.
Unclosed quote
Example message: "Row 7: unclosed quote โ field started at column 3."
A double-quote character opens a quoted field but the matching closing quote is not found before the next row delimiter or end of file. This causes the parser to consume subsequent rows as part of the same field. Fix: find the field at the specified row and column, ensure the closing double quote is present, and that any embedded double-quotes are doubled ("").
Blank header name
Example message: "Column 4 has a blank header name."
One of the fields in the header row is empty. An unnamed column cannot be referenced by name in downstream code. Fix: open the header row in a text editor and supply a name for the blank column, or remove the column if it is a spurious trailing delimiter artifact.
Duplicate header name
Example message: "Columns 2 and 5 both have the header 'email'."
Two or more header fields have the same name. Fix: rename one of the duplicate headers to make each column name unique.
UTF-8 BOM detected
Example message: "File starts with a UTF-8 BOM (EF BB BF)."
The file was saved with a byte order mark, which Excel adds to UTF-8 exports. This is usually a warning rather than an error. If your parser handles it, no action is needed. If the BOM is causing the first header name to appear with a leading invisible character, strip it. On Linux/macOS: sed -i '1s/^\xef\xbb\xbf//' file.csv.
Empty row
Example message: "Row 23 is empty."
A row containing only a newline (no field data). Usually a stray blank line inserted by a spreadsheet or text editor. Fix: delete the row. A trailing empty row at the very end of the file is acceptable per RFC 4180 and is reported as a warning rather than an error.
Mixed line endings
Example message: "File contains mixed CRLF and LF line endings."
Some rows end with \r\n (Windows/CRLF) and others end with \n (Unix/LF). Most parsers handle this gracefully, but some do not. Fix with a text editor that can normalize line endings, or with dos2unix / unix2dos on the command line.
Step 6 โ Fix and Re-Validate
After identifying issues, fix them in the source file and re-validate. The most efficient workflow:
- Note all reported issue row numbers before closing the validator.
- Open the CSV file in a text editor that shows line numbers (VS Code, Notepad++, vim). Avoid fixing CSV problems in Excel โ Excel may re-introduce quoting or encoding issues on save.
- Fix each issue starting from the lowest row number. Fixing an earlier row may change the row numbers of subsequent issues (particularly with unclosed-quote errors, which can shift everything below them).
- Save the file, then drag it back into the validator to re-validate. Repeat until the status badge turns green.
Worked Examples
Example 1: Unquoted comma in a company name
Input row:
101,Smith, Jones & Associates,[email protected],2026-01-15
This row produces a column count mismatch because the comma after "Smith" is treated as a delimiter, splitting the company name into two fields. The fix is to quote the company name:
101,"Smith, Jones & Associates",[email protected],2026-01-15
Example 2: Embedded double-quote not escaped
Input row:
42,"He said "hello" to the team",2026-02-01
The inner double-quotes around "hello" are not escaped. The parser sees the second " as the closing quote of the field, then finds unexpected content. The fix:
42,"He said ""hello"" to the team",2026-02-01
Example 3: BOM causing header lookup failure
A file exported from Excel has a BOM. The first column header appears to be id but in memory it is \ufeffid. A Python script using df['id'] raises a KeyError. The fix: open the file with encoding='utf-8-sig' in Python (which strips the BOM automatically), or strip the BOM before loading using the sed command shown in Step 5.
Example 4: Trailing delimiter creating phantom column
Every row ends with a trailing comma:
name,email,role,
Alice,[email protected],admin,
Bob,[email protected],user,
The validator reports 4 columns (header has 4 fields including the blank trailing one) and the status is valid but with a warning about the blank header name for column 4. Remove the trailing comma from every row to eliminate the phantom column.
Tips and Edge Cases
- Very large files. The tool runs in the browser using JavaScript. Files under 10 MB validate quickly. Very large files (50 MB+) may take several seconds. If you need to validate multi-gigabyte files, a command-line tool like
csvkit'scsvstatormilleris more appropriate. - TSV files. Tab-separated files with a
.tsvextension are supported. The delimiter will be auto-detected as a tab. If you have a file with a.csvextension that is actually tab-delimited, the validator will detect the tab delimiter and report it correctly. - Files with no header row. If your file has no header row, the validator will use the first data row as its column count reference. All checks still apply; blank and duplicate "header" name checks will reference the first row's values.
- Semicolon-delimited files. Files from European locales often use semicolons as delimiters. The validator detects this automatically. No configuration is needed.
- Privacy. The tool reads your file using the browser's FileReader API. The file bytes are processed in-memory by JavaScript running in your browser tab. No data is sent to any server. You can verify this in the browser's DevTools Network panel.
