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
TSV or CSV: Which to Generate
| TSV (tab) | CSV (comma) | |
|---|---|---|
| Separator | Tab character | Comma (semicolon in many European locales) |
| Commas inside values | Fine as they are | Value must be wrapped in double quotes |
| Tabs or line breaks inside values | Not allowed; this page turns them into spaces | Allowed inside quotes |
| Paste into a spreadsheet | Splits into columns automatically | Usually lands in one column; needs Split text or import |
| Specification | IANA text/tab-separated-values | RFC 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
Step 2: Set 500 rows and download
Step 3: Check what came through
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:
| Value in the file | What you may see | Why |
|---|---|---|
| 007 | 7 | Treated as a number; leading zeros dropped |
| 1234567890123456789 | 1.23457E+18 | Excel keeps only 15 significant digits |
| 1-2 | 2-Jan | Read as a date |
| MARCH1 | 1-Mar | Read as a date; why gene MARCH1 was renamed MARCHF1 in 2020 |
| =1+1 | 2 | Evaluated as a formula |
| 1,5 | 15 or 1.5 | Depends 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.
| First character | Example |
|---|---|
| = equals | =1+1 |
| + plus | +1+1 |
| - minus | -1+1 |
| @ at | @SUM(A1:A2) |
| Tab, carriage return or line feed | Invisible, 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
- IANA: text/tab-separated-values media type: header line, no tabs inside fields, equal fields per line.
- RFC 4180: Common Format and MIME Type for CSV Files: quoting rules for CSV.
- RFC 2606: Reserved Top Level DNS Names: example.com, example.org and example.net.
- NANPA: 555 line numbers: 555-0100 to 555-0199 reserved for fictional use.
- OWASP: CSV Injection: formula-starting characters and defences.
- Bruford et al. (2020), Guidelines for human gene nomenclature, Nature Genetics: renaming genes such as MARCH1 and SEPT1 that spreadsheets turned into dates.
- Microsoft Learn: Floating-point arithmetic may give inaccurate results in Excel: 15 significant digits.
- pandas documentation: read_csv: default NaN values and keep_default_na.
Related Tools
Create GUIDs for Microsoft and .NET fields.
Generate binary numbers with a chosen bit length.
Create a random pixel image and save it as a PNG.
Generate bytes in hex, Base64, or decimal format.
Pick a date between your chosen start and end dates.
Generate decimals with a chosen range and precision.