Home/Test Data/CSV Test Data Generator

CSV Test Data Generator

Generate CSV and TSV sample data with correct RFC 4180 quoting — including an option to inject the awkward values that break naive parsers.

Free Browser-based No signup Copy-ready
Schema Builder
Columns
Minimal quoting follows RFC 4180: a field is quoted only if it contains the delimiter, a quote character or a line break.
Options
Generated CSV
data.csv

      

How it works

1

Define your columns

Pick a template or build a schema from 40 realistic field types.

2

Set the dialect

Delimiter, line endings, quoting style and BOM — the four things that decide whether a file opens cleanly.

3

Download and import

Test your importer against the clean file, then again with awkward values enabled.

CSV is not as simple as it looks

CSV has a specification — RFC 4180 — that almost nothing implements exactly. Delimiters vary by locale, Excel wants a BOM, quoting rules are widely misunderstood, and every team eventually writes a parser that splits on commas and regrets it. Generating a file that deliberately contains the hard cases is the fastest way to find out whether your import pipeline is correct.

The four dialect decisions

  • Delimiter — comma by default, semicolon for locales where the comma is a decimal separator, tab when values commonly contain commas.
  • Line ending — RFC 4180 says CRLF; Unix tooling assumes LF. Both are read correctly by good parsers.
  • Quoting — minimal is standard. Quote-everything is safer for hand-rolled consumers and slightly larger.
  • BOM — required for Excel to detect UTF-8, harmful for many programmatic parsers.

Test with hostile data

Enable “awkward values” and your file will contain fields with embedded commas, doubled quotes, line breaks, leading and trailing whitespace, non-ASCII characters, leading zeros and formula-like strings.

If your importer survives that file, it will survive real customer uploads. If it does not, you have just found the bug on your own terms rather than during a migration.

CSV injection is a real vulnerability. Export user-supplied text into a CSV, have someone open it in Excel, and a cell beginning = becomes an executable formula. Sanitise on export by prefixing such cells with an apostrophe — the “awkward values” option generates examples so you can verify your handling.

Frequently Asked Questions

View all FAQs
What is CSV test data?
It is fictional tabular data created to test imports, exports, spreadsheet workflows and parsers.
When does a CSV field need quotes?
Under common RFC 4180-style rules, quote a field when it contains the delimiter, a double quote or a line break.
How do you escape a quote inside CSV?
Inside a quoted field, represent a double quote as two double quotes.
Should CSV use CRLF or LF?
RFC 4180 describes CRLF, while LF is also common in modern systems. Use and test the line ending your integration supports.
What does UTF-8 BOM do?
It can help some spreadsheet workflows identify UTF-8 encoding. It is not required for every UTF-8 CSV file.
Can CSV contain newlines inside a value?
Yes, when the field is quoted correctly.
Can I regenerate the same CSV?
Yes. Keep the same seed, schema and settings for repeatable fixture generation.

CSV Test Data Generator – Create Realistic Sample CSV Files

Use the CSV Test Data Generator above to create mock tabular data for imports, exports, spreadsheets, parsers and QA.

Choose a template or define your own columns, set the number of rows and a repeatable seed, then control the delimiter, line ending and quoting style. You can include a header row, add a UTF-8 BOM for Excel-oriented workflows, sprinkle empty cells or deliberately inject awkward values containing commas, quotes, newlines and Unicode.

That last option matters.

A CSV parser that works only with simple values such as Alice,32,London has not been tested very hard. Real files eventually contain punctuation, missing values and text that crosses assumptions.

What Is a CSV Test Data Generator?

A CSV test data generator creates fictional rows in a delimiter-separated tabular format.

A basic CSV file might look like:

id,name,active
1,Alice,true
2,Bob,false

Each row represents a record.

Each field occupies a column.

CSV is widely used because spreadsheets, databases, analytics tools and programming languages can all read or write it.

However, CSV has details that are easy to get wrong, especially around quotes and line breaks.

Generating deliberate edge cases is often more useful than generating thousands of perfectly clean rows.

How to Use This CSV Generator

Start with a template or add your own columns.

Choose realistic field types for each column.

For example:

id → sequence
name → full name
email → email
amount → price
created_at → timestamp

Set the number of rows.

Add a seed when you want the same test file to be regenerated later.

Next, choose:

  • delimiter
  • line ending
  • quoting mode
  • header behavior
  • UTF-8 BOM
  • awkward values
  • empty-cell frequency

Generate the file and inspect both the raw CSV and preview.

The preview should look right, but the raw view is where quoting and line-ending problems become visible.

RFC 4180 and CSV Quoting

RFC 4180 documents a common CSV format.

One important rule is that fields containing certain characters need quoting.

A field should be enclosed in double quotes when it contains:

  • the delimiter
  • a double quote
  • a line break

For example:

1,"Smith, Jane",Active

The comma inside the name is data, not a column separator, because the entire field is quoted.

If a field itself contains a double quote, that quote is escaped by doubling it.

Example:

"He said ""hello"""

A parser must interpret that as:

He said "hello"

This is why naive split(",") parsing fails on real CSV.

Minimal Quoting vs Quote Everything

There are two common output styles.

Minimal quoting wraps only fields that need quotes.

Example:

1,Alice,"New York, NY"

Quote all wraps every field.

Example:

"1","Alice","New York, NY"

Both can be valid.

Minimal quoting produces cleaner, smaller files.

Quoting every field can simplify some integrations and make the format visually consistent.

The receiving system matters more than personal preference.

If you are testing an import pipeline, generate the style the pipeline is expected to accept.

Commas Inside CSV Fields

A comma inside a field is not a problem when the field is quoted correctly.

Example:

42,"Last name, First name",active

The parser sees three fields, not four.

This is one of the most important CSV tests because human-entered text commonly contains punctuation.

Addresses, company names, descriptions and product titles may all contain commas.

If an import succeeds only when all generated text avoids commas, the importer may fail as soon as real users provide normal content.

Enable awkward values specifically to expose this class of bug.

Newlines Inside CSV Fields

CSV fields can contain line breaks when quoted.

For example, an address might contain multiple lines inside one field.

That means one logical CSV record can occupy more than one physical text line.

A line-by-line parser that assumes each newline always means the next row can break.

This is a valuable test for addresses, notes, comments, descriptions, exported text areas and customer-support data.

If your application explicitly forbids newlines in a field, test that validation too.

The generator can create awkward values so you can prove your parser handles or rejects them intentionally.

CRLF vs LF Line Endings

RFC 4180 describes records separated with CRLF.

In practice, many modern tools also work with LF-only files.

The common representations are:

CRLF: \r\n

LF: \n

Windows-oriented exports frequently use CRLF.

Unix and many web-development workflows commonly use LF.

If you are testing cross-platform imports, try both.

A robust parser should follow the requirements of your product rather than assuming every file was generated on the same operating system.

CSV Delimiters Are Not Always Commas

Despite the name, real-world delimited files may use commas, semicolons, tabs or pipes.

Regional spreadsheet settings can make semicolon-delimited files especially common where commas are used as decimal separators.

A tab-delimited file is often called TSV rather than CSV, but many import systems treat delimiter choice as one configurable family of formats.

Use the delimiter your receiving application expects.

Then test data that contains that same delimiter inside quoted fields.

That is where parser correctness becomes obvious.

UTF-8 and Excel BOM

UTF-8 can represent international characters such as:

José
München
東京
বাংলা

A UTF-8 BOM is a small byte marker sometimes added at the beginning of a text file.

Modern software generally understands UTF-8 without it, but some Excel-oriented workflows use the BOM to help recognize encoding correctly.

If your CSV will be opened in spreadsheet software, test the actual path users follow.

A file that looks correct in a code editor may display accented or non-Latin characters incorrectly in another program if encoding is misdetected.

The BOM option exists for interoperability, not because every UTF-8 CSV requires one.

Empty Field vs Missing Column

These concepts are different.

A row like:

1,,active

contains an empty second field.

The column is still present.

If a row has fewer delimiters than expected, it may have fewer fields entirely.

That distinction matters to importers.

Empty values may map to an empty string, null, default value or validation error depending on your system.

Use the “sprinkle empty cells” option to test how your pipeline handles missing content without corrupting the column structure.

CSV vs JSON for Test Data

CSV is best suited to flat tabular data.

JSON handles nested structures naturally.

If a record contains arrays or nested objects, forcing it into CSV usually requires flattening or encoding those structures as strings.

Use CSV when you are testing spreadsheet import, flat database export, bulk upload or tabular interchange.

Use the JSON Test Data Generator when the structure includes nested objects, arrays or native JSON booleans and nulls.

The data format should match the integration, not whichever generator you opened first.

Test Your Parser with Awkward Values

The most valuable CSV file may be the ugly one.

Try values containing:

  • delimiter characters
  • double quotes
  • line breaks
  • Unicode
  • blank cells
  • very long text
  • leading zeros
  • dates
  • numbers that look like scientific notation

Spreadsheet software may reinterpret some values automatically.

For example, product codes, ZIP codes or account references can lose leading zeros when treated as numbers.

CSV itself does not define a rich type system. Every field is textual data whose interpretation is left to the consuming application.

Common CSV Test Data Mistakes

Avoid these problems:

  • Parsing with a simple string split
  • Forgetting to escape quotes inside quoted fields
  • Assuming one physical line always equals one record
  • Treating a UTF-8 BOM as mandatory everywhere
  • Assuming CSV fields carry reliable data types
  • Generating only ASCII values
  • Testing only comma delimiters when your product supports others
  • Ignoring empty cells
  • Using random fixtures that cannot reproduce a parser failure
  • Opening a file in a spreadsheet and assuming that proves the raw CSV is correct

Inspect both the raw text and the behavior of the actual parser you are testing. For nested or typed data, see the JSON Test Data Generator; for database seed scripts, see the SQL Insert Data Generator.

Related searches

csv test data generatorrfc 4180 csvcsv quoting rulescsv escape double quotescsv crlf vs lfcsv utf-8 bomcsv delimiter testingcsv parser edge casessample csv file generatorcsv newline in fieldcsv empty field vs missing columnseeded csv fixtures