.tsv

TSV test files

Tab-separated values for database loaders, spreadsheet imports and command-line tools, with or without escaped tabs and line breaks.

Or start from a preset

What is a TSV file?

Short answer

A TSV file stores a table as text: one record per line, fields separated by a tab character. Unlike CSV there is no quoting, so a field may not contain a tab or a line break unless the tool agrees on an escape such as \t.

Database tools like PostgreSQL COPY and MySQL LOAD DATA use backslash escapes for tabs and newlines inside values. The generator can write those escapes, or keep fields free of them the way the IANA definition of TSV requires.

Anatomy of a TSV file

  • \tThe field separator, one tab character
  • line breakEnds a record; LF by default, CRLF as an option
  • header rowOptional column names on the first line
  • \t \n \\Backslash escapes for a tab, newline or backslash inside a value

What you can generate

  • Backslash-escaped tabs, newlines and backslashes inside values
  • Unicode text and emoji
  • Empty cells and leading zeros
  • Formula-like cells for injection tests
  • Ragged rows with a field too few or too many
  • LF or CRLF line endings

How to make one

  1. Open the TSV generator, or start from a preset above.
  2. Set the size and switch on the edge cases you need; the preview and size estimate follow every change.
  3. Generate, then download. The file is made in your browser, and the same preset and seed always give you the same file.

Questions

TSV separates fields with a tab and has no quoting. That makes it easy to split, but a value that contains a tab or line break must be escaped or cleaned first.

Backslash escapes: \t for a tab, \n for a newline, \r for a carriage return and \\ for a backslash, as PostgreSQL COPY and MySQL write them.

Yes. Excel and LibreOffice open .tsv files and detect the tab separator.

Related formats