Count TSV Rows
Count rows in TSV (Tab-Separated Values) data instantly. Paste or upload TSV files to get total row count, data rows, and column statistics.
About
Miscounting rows in a TSV file before a database import leads to silent data loss. A trailing newline adds a phantom row. An embedded line break inside a quoted field splits one record into two. This tool parses raw TSV text and reports the exact count of total lines, non-empty data rows, and detected columns from the first record. It distinguishes between blank lines (matching ^\s*$) and actual data, so you know precisely what your import script will consume. The count assumes standard TSV conventions: no quoting, no escaped tabs, one record per line.
Formulas
The row count is computed by splitting the input on newline characters and applying optional filters:
Where Rempty counts lines matching the regular expression ^\s*$ (zero or more whitespace characters). Rheader is 1 if the user opts to exclude a header row, 0 otherwise. Column count C is derived from the first non-empty line: C = split(line0, \t).length. A trailing newline produces one additional empty string after the final split. The tool detects and discards this phantom entry to avoid off-by-one errors.
Reference Data
| Format | Delimiter | Typical Extension | Quoting Convention | Max Columns (Practical) | Line Ending | Encoding | Header Row | Empty Field | Common Use |
|---|---|---|---|---|---|---|---|---|---|
| TSV | Tab (\t, U+0009) | .tsv, .txt | None (fields must not contain tabs) | Unlimited | LF or CRLF | UTF-8 | Optional | Adjacent tabs | Bioinformatics, spreadsheets |
| CSV | Comma (,) | .csv | Double-quote RFC 4180 | Unlimited | CRLF (RFC) | UTF-8 / Latin-1 | Optional | Adjacent commas | General data exchange |
| SSV | Semicolon (;) | .csv (locale) | Double-quote | Unlimited | CRLF | UTF-8 | Optional | Adjacent semicolons | European Excel exports |
| PSV | Pipe (|) | .txt, .psv | Rare | Unlimited | LF or CRLF | UTF-8 | Optional | Adjacent pipes | Legacy mainframe data |
| Fixed-Width | Column positions | .txt, .dat | None | Defined by spec | LF or CRLF | ASCII / EBCDIC | Optional | Spaces | Government filings |
| JSON Lines | Newline per object | .jsonl | JSON strings | N/A (key-value) | LF | UTF-8 | N/A | NULL | Log streaming |
| Parquet | Binary columnar | .parquet | N/A | Unlimited | N/A | Binary | Schema | Null bitmap | Big data / analytics |
| Excel XLSX | XML cells | .xlsx | N/A | 16384 | N/A | UTF-8 XML | Optional | Empty cell element | Business reporting |
| IANA TSV | Tab (IANA registered) | .tsv | None (strict) | Unlimited | LF (IANA rec.) | UTF-8 | Required (IANA) | Adjacent tabs | Standards-compliant exchange |
| W3C WebVTT | Tab (cue fields) | .vtt | None | 3 | LF or CRLF | UTF-8 | Signature line | Empty cue | Video subtitles |
| BED Format | Tab | .bed | None | 12 (standard) | LF | ASCII | None (track lines) | Period (.) | Genomic intervals |
| VCF | Tab | .vcf | None | 8 + samples | LF | UTF-8 | Meta + header | Period (.) | Variant calling |
| GFF3 | Tab | .gff3 | URL-encoded | 9 | LF | UTF-8 | Directive lines | Period (.) | Gene annotation |
| SAM | Tab | .sam | None | 11 + optional | LF | ASCII | @-prefixed headers | Asterisk (*) | Sequence alignment |