Developer and Text Tools

How to Validate a CSV File Before You Import It

Check a CSV against RFC 4180 before importing: detect the delimiter and find rows with the wrong column count, broken quotes and duplicate headers.

Saizul Amin
Saizul Amin30 Oct 2026 · 3 min read
How to Validate a CSV File Before You Import It

How to Validate a CSV File Before You Import It

CSV looks like the simplest data format there is, yet CSV imports fail constantly. A database load stops at row 48,213 with "extra data after last expected column", a spreadsheet splits an address across two cells, or a CRM import quietly drops half the records. The free CSV Validator and Linter checks a file before you import it and lists every problem with its line number, so you fix the data once instead of retrying the import again and again.

What the standard says

RFC 4180 is the closest thing CSV has to a specification. Its rules are short:

  • Each record is one line ending in a line break, and every record has the same number of fields.
  • Fields that contain the delimiter, a double quote or a line break must be wrapped in double quotes.
  • A double quote inside a quoted field is written as two double quotes.
  • The first line may be a header with field names.

Real files bend these rules all the time, which is why a validator needs to understand both the standard and the common variations.

Problems the validator finds

  • Wrong column count: a row with more or fewer fields than the header. The usual cause is an unquoted comma inside a value, such as an address or a company name with "Ltd, London".
  • Unclosed quotes: a field that opens a quote and never closes it swallows every following line into one value. The validator reports where the quote started.
  • Stray quotes: a quote in the middle of an unquoted field, such as 5" screen, which strict parsers reject.
  • Empty rows and trailing delimiters, often left by spreadsheet exports.
  • Duplicate or blank headers, which break imports that map columns by name.

Delimiter detection

Not every "comma-separated" file uses commas. Many European systems export with semicolons, because the comma is the decimal separator there, and database dumps often use tabs or pipes. The validator samples the file, tests the common delimiters and picks the one that gives the most consistent column count. You can override it if the guess is wrong.

Column profiling

Beyond structure, the tool profiles each column: how many values are empty, whether values look like integers, decimals, dates, booleans or text, and how many distinct values appear. This catches problems a structural check misses, such as a numeric column with a few values like "n/a", or a date column mixing day-first and month-first formats.

Encoding and Excel

If accented characters look garbled after import, the file's encoding probably does not match what the importer expected. Save CSV as UTF-8, and if Excel will open it, UTF-8 with a byte-order mark helps Excel detect the encoding. Excel also converts long numbers such as phone numbers and IDs to scientific notation and strips leading zeros, so do not round-trip data files through Excel before an import.

Fixing the problems

Most issues have simple fixes once you know the line. Quote any field that contains the delimiter. Double any quote inside a quoted field. Delete blank lines at the end. For large files with many bad rows, fix the export settings in the source system rather than editing the output by hand.

Step by step

  1. Paste the CSV or open the file.
  2. Confirm or choose the delimiter.
  3. Read the list of problems and their line numbers.
  4. Check the column profile for unexpected types and empty values.
  5. Fix the source or the file, then validate again before importing.

Privacy

The file is read and checked in your browser. Customer lists, financial exports and other sensitive data are never uploaded.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages