Skip to content

Generate Random TSV

Build a random test table column by column: names, emails, phone numbers, cities, numbers, dates, categories and UUIDs, with optional blanks and tricky values that break importers. Generate up to 10,000 rows and copy or download as TSV or CSV.

Fictional names, example.com emails and 555-01xx phone numbers

Columns
% = chance a cell is left blank
1 lines · 9 columns

TSV or CSV: Which to Generate

Differences between tab-separated and comma-separated files
TSV (tab)CSV (comma)
SeparatorTab characterComma (semicolon in many European locales)
Commas inside valuesFine as they areValue must be wrapped in double quotes
Tabs or line breaks inside valuesNot allowed; this page turns them into spacesAllowed inside quotes
Paste into a spreadsheetSplits into columns automaticallyUsually lands in one column; needs Split text or import
SpecificationIANA text/tab-separated-valuesRFC 4180

TSV is the better choice for copy-and-paste and for data full of commas, such as addresses and prices written 1,250.00. CSV is what most import screens ask for. The IANA definition of TSV expects a header line of field names and the same number of fields on every line; both are true of the output here.

Worked Example: Testing a 500-Customer Import

A developer is building a "bulk import customers" screen and needs a realistic file, without touching real customer data.

Step 1: Load the Customers preset

id · first_name · last_name · email · phone (20% blank) · city · signup_date · plan · monthly_spend

Step 2: Set 500 rows and download

Header on → the file has 501 lines: 1 header + 500 customers

Step 3: Check what came through

500 records created · Zoë, Łukasz and São Paulo intact · blank phones accepted · dates stored as dates

Then run it again with "Include tricky values" ticked. The happy-path file proves the import works; the tricky one shows how it fails, which is what users will actually hit. Count the rows that were rejected and read the error messages: they should name the line and the column.

What Spreadsheets Do to Your Data

Opening a TSV or CSV file by double-clicking lets the spreadsheet guess each value's type, and some guesses quietly change the data:

Values that spreadsheets commonly change when opening delimited files
Value in the fileWhat you may seeWhy
0077Treated as a number; leading zeros dropped
12345678901234567891.23457E+18Excel keeps only 15 significant digits
1-22-JanRead as a date
MARCH11-MarRead as a date; why gene MARCH1 was renamed MARCHF1 in 2020
=1+12Evaluated as a formula
1,515 or 1.5Depends on the computer's decimal separator

To keep values exactly as written, import instead of opening (Excel: Data → From Text/CSV, then set columns to Text; Google Sheets: File → Import with "Convert text to numbers, dates and formulas" turned off). Downloads from this page include a UTF-8 byte-order mark so Excel shows accented names correctly.

The Tricky Values and What They Catch

With Include tricky values ticked, about 15% of text cells (names, cities, categories and words) are replaced with one of these. Number, date and ID columns stay valid, so you can see which column caused a failure.

  • 007, 1234567890123456789: codes and IDs that must stay text.
  • 1-2, MARCH1, TRUE: text that looks like a date or a boolean.
  • NULL, NA: real values (a surname, a country code for Namibia) that many tools read as missing. pandas does this by default.
  • Zoë "Zo" O'Neil: accents, double quotes and an apostrophe in one value; it tests CSV quoting and SQL escaping.
  • padded : leading and trailing spaces; should they be trimmed or kept?
  • 1,5: a decimal comma that a CSV parser may split into two fields.
  • =1+1: a formula, covered in the next section.

Formula Injection in Exported Files

If your application lets users type text that later appears in a TSV or CSV export, a value such as =HYPERLINK(…) becomes a live formula when someone opens the file in a spreadsheet. OWASP calls this CSV (formula) injection.

Characters that can start a formula when a cell is opened in a spreadsheet
First characterExample
= equals=1+1
+ plus+1+1
- minus-1+1
@ at@SUM(A1:A2)
Tab, carriage return or line feedInvisible, followed by one of the above

OWASP's suggested defence for exports is to prefix such cells with a single quote and escape quotes in the field. The =1+1 tricky value lets you check whether your export does this: open the exported file and see whether the cell shows 2 or the text.

Fake Data That Can’t Reach Real People

Test files get emailed, attached to tickets and loaded into staging systems that send real notifications. Generated values are chosen so that can't hurt anyone:

  • Emails use example.com, example.org and example.net, which RFC 2606 reserves for documentation and never delivers to anyone.
  • Phone numbers use 555-0100 to 555-0199, the North American range NANPA keeps for fictional use, so a stray text or call goes nowhere.
  • Names are picked at random from a mixed list that includes accents and apostrophes (García, Łukasz, O'Brien), so the data looks like a real customer base without describing anyone.

That is safer than copying a production export and "anonymising" it: real records are easy to re-identify from a few columns, and test environments are rarely as well protected as production.

Reading TSV Safely in Python

import csv

with open('random-data-500-rows.tsv', encoding='utf-8-sig', newline='') as f:
    rows = list(csv.DictReader(f, delimiter='\t'))

# pandas: read everything as text first, and don't turn 'NA' or 'NULL' into missing values
import pandas as pd
df = pd.read_csv('random-data-500-rows.tsv', sep='\t', dtype=str, keep_default_na=False)

utf-8-sig strips the byte-order mark so the first column name isn't read as "\ufeffid". With dtype=str and keep_default_na=False, values like 007 and NA survive exactly; convert the columns you know are numbers or dates afterwards.

Frequently asked questions

What is a TSV file?

A plain-text table where a tab separates the fields on each line and each line is one row. It opens in any spreadsheet and is easier than CSV when values contain commas.

How do I paste the data into Excel or Google Sheets?

Keep the separator on Tab, press Copy, click the top-left cell and paste. Tab-separated text splits into columns automatically.

Can I make a CSV instead?

Yes. Change the separator to Comma (or Semicolon for European versions of Excel). Values containing the separator, quotes or line breaks are quoted as RFC 4180 describes.

Are the names and emails real?

No. Names are random combinations from a built-in list, emails use domains reserved for examples, and phone numbers are in the fictional 555-01xx range.

Sources