tsvkit.org
TSV Toolkit
Sample data Say hi →

TSV Validator

reports ragged rows by line number · expected vs actual column count

Check whether a TSV is rectangular before something downstream refuses it. The header row sets the expected column count, and every row that differs is listed with its line number and how many columns it actually has — which is the information the error message from your loader usually withholds. Finding the line is the first half of the job; fix ragged rows is the second.

validator
Drop a .tsv file here, or
ready

How to use

  1. Paste or drop the file. The report appears on the right.
  2. If it says OK, the file is rectangular and every row matches the header's column count.
  3. If it says RAGGED, note the line numbers and open the file at those lines before you fix anything — the pattern tells you the cause.

Reading the pattern, not just the lines

One extra column on the bad rows means a tab inside a field — the field split in two and everything after it shifted right. The data in that row is now in the wrong columns, so padding it would produce a row that counts correctly and reads wrongly. Fix the export, or convert to escaped form with escape tabs and newlines. Adjacent pairs of short rows mean a newline inside a field: one record became two lines. Trailing columns missing across many rows usually means the producer omitted empty trailing fields, which is harmless and is exactly what padding is for. Blocks of differing widths suggest two files were concatenated — merge handles that properly by unioning headers.

What it doesn't check

Only the column count. It says nothing about whether values are the right type, whether required fields are populated, or whether a date parses — for those, the schema generator shows the inferred type and nullability per column, and stats gives you the null counts. It also can't detect a file that's uniformly wrong: if every row has the same wrong number of columns, the file is rectangular and validates cleanly.

FAQ

It says OK but my loader still rejects the file.

The column count isn't the only thing that can be wrong. Check for a BOM (BOM tools), CRLF line endings (line endings), or a bad encoding (convert encoding) — those three account for most "valid but rejected" files.

Are quoted fields understood?

Yes — the parser reads RFC 4180 quoting, so a quoted field containing a tab or newline counts as one field and doesn't register as ragged. Note that strict TSV readers won't be so forgiving.

How many issues does it list?

Up to 500 individual lines, then a count of the remainder — enough to see the pattern without producing an unreadable wall of text.

What's the awk equivalent?

awk -F'\t' 'NR==1{n=NF} NF!=n{print NR": "NF" (expected "n")"}' f.tsv — the same check, faster on very large files.

Privacy

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