PrivateCSV

Validate a CSV file and find errors

Find broken rows, bad quotes and encoding problems before an import fails.

CSV file

  • Nothing is uploaded
  • Free
  • No sign-up

Guide

CSV Validator: the complete guide

Last updated 5 min read

About this tool

The PrivateCSV validator reads a CSV file and lists every structural problem with its row number: rows with too many or too few fields, unclosed quotes, empty or duplicate column names, blank rows and text that is not valid UTF-8. Each problem row is shown cell by cell under its column names, with the extra, missing or unreadable cells highlighted, and the rows without errors can be saved apart from the rows to fix. Use it before an import, or after one fails with a vague message. The file is checked on your device and never uploaded.

How to check that your file is never uploaded

How to validate a CSV file

  1. Choose the CSV file to check.
  2. Leave “First row is a header” ticked if the first row holds column names. The header sets how many fields every row should have.
  3. Click Validate CSV.
  4. Read the summary and the problems grouped by type, each with its likely cause and how to fix it. Click a type to see only those rows.
  5. Optionally, separate the valid rows from the rows to fix: import the first file now, correct the second, then merge them.

Example

A file with one extra field and a blank line.

products.csv
id,product,price
1,"Desk lamp, black",24.90
2,Chair,49.00,in stock

3,Shelf,35.00
Validation result
Row 3 - error: Row has 4 fields, expected 3.
Row 4 - warning: Empty row.

When you need it

Before importing into a CRM, shop or database
One malformed row can abort an import or, worse, shift values into the wrong columns without any error. Checking first takes seconds and tells you exactly which rows to fix.
When an import fails with a vague error
Messages like “invalid file format” or “line 18442 could not be parsed” rarely say what is wrong. The validator names the problem: an unclosed quote, an extra delimiter, an empty column name.
Checking files exported from Excel
Excel saves CSV with your regional list separator (often a semicolon in Europe) and, unless you choose “CSV UTF-8”, in a legacy encoding such as Windows-1252. The validator reports the delimiter it found and flags text that is not valid UTF-8.

What the validator checks

  • Field count: every row must have as many fields as the header, or as the first row when there is no header. Each mismatch is an error.
  • Quotes: a quoted field that is never closed swallows the rest of the file. Unclosed or misplaced quotes are errors.
  • Column names: empty names and duplicates (ignoring case and surrounding spaces) are warnings, because many importers reject them. Leading or trailing spaces are noted.
  • Blank rows: empty rows in the middle of the file are warnings. Blank lines at the very end are ignored.
  • Encoding: every row containing text that is not valid UTF-8, typically from a Windows-1252 export, is reported, with the unreadable cells highlighted.
  • Byte order mark: a UTF-8 BOM at the start of the file is noted. It is valid, and Excel needs it to show accented letters correctly, but a few older importers read it as part of the first column name.

Seeing exactly what is wrong in each row

  • Each problem row is displayed under the column names, so you see which value landed in which column.
  • Cells beyond the expected number of fields are marked as extra, and missing ones as missing.
  • When a row has too many fields and one of them starts with a space, such as “ France” after “Paris”, it is flagged as the likely spot where an unquoted delimiter cut a value in two.
  • When almost every row has the wrong width, the report says so: the header or the delimiter is the likely cause, not the rows themselves.
  • The list of problems can be downloaded as a CSV report to share with whoever produced the file.

The rules a valid CSV file follows

CSV is described by RFC 4180, and its core rules are short. Records are separated by line breaks. Every record has the same number of fields. A field that contains the delimiter, a double quote or a line break must be enclosed in double quotes, and a double quote inside such a field is written twice ("").

The RFC uses commas, but semicolons are standard in countries that write decimals with a comma, and tabs are used in TSV files. The validator detects comma, semicolon, tab and pipe delimiters automatically.

Limits to know about

  • It checks structure, not meaning: it cannot know that a column should hold dates or that an email address is wrong.
  • Up to 500 issues are listed in detail; the totals count every issue in the file.
  • Row numbers count CSV records, with the header as row 1. A record that contains line breaks spans several lines in a text editor, so editor line numbers can be higher.

Frequently asked questions

What makes a CSV file invalid?

The most common problems are rows with a different number of fields than the header, quotes that are opened but never closed, and empty or duplicate column names. Encoding problems do not break the structure, but they corrupt accented characters and symbols.

Why do some rows have the wrong number of fields?

Usually a value contains the delimiter without being quoted, such as an address “12 Main St, Apt 4” in a comma-separated file, or a stray quote character breaks the quoting. Fix the export so such values are quoted, or remove the extra delimiter in the reported rows.

Why do accented characters show up as � or é?

The file and the program reading it disagree about the encoding. � usually means a Windows-1252 file read as UTF-8. é means a UTF-8 file read as Windows-1252, which is what Excel does when you double-click a UTF-8 CSV that has no byte order mark. In Excel, use Data > From Text/CSV and choose “65001: Unicode (UTF-8)” as the file origin.

How do I know the encoding of a CSV file?

A CSV file does not store its encoding, so programs have to guess. Validate it here: if no encoding problem is reported, the file is valid UTF-8 (plain ASCII is too), and a UTF-8 byte order mark is noted when present. If rows are flagged as not valid UTF-8, the file is in a legacy encoding, most often Windows-1252 from Excel. Re-save it from Excel as “CSV UTF-8 (Comma delimited)”, or in Notepad with UTF-8 as the encoding.

Why does the row number not match the line number in my editor?

Row numbers count CSV records, with the header as row 1. A quoted value can contain line breaks, so one record can take several lines in a text editor.

Can I keep only the rows without errors?

Yes. After validating, click “Separate valid rows from rows to fix”. You get two files with the same header and delimiter: one with every row that has no structural error, one with the rows to correct. Empty rows are left out of both.

Can it check column types or required values?

Not yet. The validator checks the structure every CSV file must get right. Rules for specific columns, such as required values or date formats, are a separate kind of check.

Related tools

Go further

Your files never leave your device

PrivateCSV runs every tool inside your browser. No upload, no account, nothing to install.