Skip to content
AgileLogics

Random TSV Generator

Generates a tab-separated grid of random 8-character alphanumeric values, for testing imports or layouts.

How it works

Choose the number of rows and columns, then click Generate.

What is a TSV file, and what does this generator make?

A TSV (tab-separated values) file is a plain-text table: each line is one record and a tab character separates the values within it. This generator fills such a table with random 8-character strings of letters and digits, from 1 to 50 rows and 1 to 10 columns, ready to paste into a spreadsheet or pipe into a command-line script.

Why tabs instead of commas?

Commas show up in ordinary data all the time (addresses, prices, prose), so CSV needs a quoting system to tell a separator from content. Tabs almost never appear in real values, so TSV mostly skips the problem. The IANA registration for text/tab-separated-values settles it bluntly: fields containing tabs are simply not allowed, and there is no escape mechanism at all.

That trade-off makes TSV the format of choice for:

  • Clipboard transfer. Spreadsheets copy cells to the clipboard as tab-separated text and paste it back the same way.
  • Unix pipelines. cut, sort and awk handle tab-delimited columns with almost no options.
  • Database exports. PostgreSQL's COPY uses a tab as its default delimiter in text format.

Creating a grid

  1. Choose the number of Rows (1 to 50).
  2. Choose the number of Columns (1 to 10).
  3. Click Generate, then Copy.
  4. Paste into cell A1 of a spreadsheet, or into a file named sample.tsv.

Two rows and three columns came out like this:

uD3k2PBl	1NPcG7EJ	kX5iU5lt
YIm1ldr4	Ix6UxhwC	uw3IvZ4V

Values are built in the browser from crypto.getRandomValues(); the page sends nothing to a server.

Checking the output against the IANA rules

IANA requirement Generated output
First line contains the field names Not included; add your own
Each record is a single line Yes, rows end with a line feed
Every record has the same number of fields Yes
Fields may not contain tabs Guaranteed, values are alphanumeric

The missing header is easy to fix and worth fixing if the file is going into a library like pandas, which treats the first line as column names by default and would otherwise turn your first random row into headers.

Seeing and using the tabs

In the output box a tab renders as whitespace up to the next tab stop, so columns can look ragged or appear to be separated by a variable number of spaces. They aren't. On Linux you can prove it with cat -A sample.tsv (on macOS, cat -t), which shows each tab as ^I.

Once saved, the file works with standard tools without extra flags, because cut splits on tabs by default:

cut -f2 sample.tsv                    # second column
awk -F'\t' '{print $3, $1}' sample.tsv  # reorder columns
sort -t$'\t' -k2 sample.tsv           # sort by column 2

In Python, csv.reader(f, delimiter='\t') reads the same file. If shell scripting is new to you, the Bash overview is a good starting point.

When to pick TSV and when to pick CSV

Situation Better choice
Pasting into Excel or Google Sheets TSV, it lands as cells
Uploading to a web app's import screen Usually CSV, it's the more common upload format
Processing with cut or awk TSV
Data that may legitimately contain tabs CSV, which can quote them

If your target wants commas, the random CSV generator produces the same kind of grid with comma separators. For a single long random token rather than a grid, use the random alphanumeric generator, and to turn a grid into web markup, paste it into the HTML table generator.

Last updated

Frequently asked questions

Why does the output look like it's separated by spaces?
Tab characters are invisible and display as a jump to the next tab stop, so they look like runs of spaces. They are real tab characters (U+0009), and Copy puts them on your clipboard intact.
Will it paste into Excel or Google Sheets as columns?
Yes. Spreadsheets treat tab-separated text on the clipboard as a block of cells, so pasting the output into cell A1 fills one value per cell without an import wizard.
Does the output follow the official TSV format?
Almost. It meets the IANA rules that every record has the same number of fields and no field contains a tab. The IANA definition also says the first line holds field names, and this generator doesn't add one, so type a header line yourself if a program expects it.
What characters appear in the values?
Only A-Z, a-z and 0-9, eight per cell, chosen with the browser's secure random generator. There are no spaces, quotes or tabs inside a value, so nothing needs escaping.