csvkit.org
CSV (Comma-Separated Values) utilities, in the browser
Say hi →

Repair a Broken CSV

ragged rows · unbalanced quotes · BOM · mixed newlines · change report

Most "invalid CSV" errors come from four things: rows with the wrong number of columns, a quote that was never closed, a byte-order mark on the first header, and mixed line endings. This tool fixes all four in one pass and shows you a report of exactly what it changed — so you can decide whether the fix is safe before you rely on the output.

repair
Or drop a .csv file here, or
ready

How to repair a CSV

  1. Paste the file or drop it in. The report table lists the detected delimiter, quote problems, and how many rows were the wrong width.
  2. Choose how to treat ragged rows. Pad / truncate is the safe default; merge is right when an unescaped comma split one field in two; drop and list keeps your data honest by quarantining anything suspect.
  3. Leave strip BOM and drop blank rows on unless you have a reason not to.
  4. Check the report, then copy or download the repaired file. Output is re-quoted properly and comma-delimited.

What each fix actually does

When repair isn't the answer

If rows are ragged because the source system escapes quotes with a backslash instead of doubling them, or because the file is really two concatenated exports with different headers, padding the rows just hides the problem. The report is there to make that visible: a file where most rows are the wrong width is usually a delimiter or export bug, not damage worth patching. In that case fix the export, or split the file first with Split CSV.

FAQ

Will repairing change my data?

Padding adds empty fields, truncating discards trailing fields, and merging joins them back into the last column — all visible in the report. Blank-row removal and BOM stripping never touch real values.

How do I know which rows were broken?

The report counts short and long rows, and in quarantine mode lists their row numbers and actual widths so you can inspect the source.

Can I just check whether a CSV is valid?

Yes — Validator reports problems without rewriting anything, and Data profile shows fill rates and type mismatches per column.

Is the file uploaded?

No. Parsing and repair happen in your browser; nothing is sent anywhere.

Privacy

100% client-side. No upload. See the privacy policy.