Skip to content
faker.tools
All 79

Plate IV · Developer, API & Database Seeding Utilities

CSV & TSV Dataset Generator

Sample CSV files with the delimiters, quoting, line endings and BOM that break real imports.

csv
id,fullName,email,city,isActive,createdAt
1,Alice Young,alice.young@example.com,Boise,true,2026-01-30T23:11:06Z
2,Ryan Lopez,ryan.lopez@example.com,Brooklyn,true,2026-04-09T23:11:06Z
3,Linda Anderson,linda.anderson@example.com,Savannah,false,2026-04-21T23:11:06Z
4,Iris Martin,iris.martin@example.com,Portland,true,2024-05-09T23:11:06Z
5,Thomas Moore,thomas.moore@example.com,Boise,true,2025-08-04T23:11:06Z
6,Patricia Smith,patricia.smith@example.com,Portland,true,2026-03-12T23:11:06Z
7,Margaret Garcia,margaret.garcia@example.com,Boise,false,2026-06-18T23:11:06Z
8,Elijah Williams,elijah.williams@example.com,Austin,false,2026-07-13T23:11:06Z
9,Jason Hill,jason.hill@example.com,Savannah,true,2026-08-25T23:11:06Z
10,Jason Davis,jason.davis@example.com,Savannah,true,2026-01-08T23:11:06Z
11,Eric Lopez,eric.lopez@example.com,Boise,true,2026-04-29T23:11:06Z
12,Sarah Hernandez,sarah.hernandez@example.com,Chicago,true,2024-09-28T23:11:06Z
13,Sarah Allen,sarah.allen@example.com,Chicago,true,2026-09-25T23:11:06Z
14,Joseph Williams,joseph.williams@example.com,Brooklyn,true,2025-03-23T23:11:06Z
15,Lisa Lewis,lisa.lewis@example.com,Austin,true,2026-03-02T23:11:06Z
16,Elijah Moore,elijah.moore@example.com,Portland,true,2024-10-05T23:11:06Z
17,Jennifer Torres,jennifer.torres@example.com,Boise,true,2025-10-07T23:11:06Z
18,Jessica Martinez,jessica.martinez@example.com,Chicago,true,2026-04-26T23:11:06Z
19,Michael Martinez,michael.martinez@example.com,Portland,true,2025-04-05T23:11:06Z
20,Elijah Flores,elijah.flores@example.com,Boise,true,2025-09-19T23:11:06Z
21 lines · 1.5 KBGenerated in your browser · CSV & TSV Dataset Generator

A CSV generator produces sample spreadsheet data for testing imports, exports and data pipelines. Pick from thirty-three realistic field types, choose a delimiter, and download a file with up to 5,000 rows. The options are the ones that actually break CSV importers: quoting, delimiters, Windows line endings and the UTF-8 byte order mark Excel needs.

CSV has a standard — RFC 4180 — and almost nobody follows it exactly. That is why a sample file with the right awkward properties is more useful than a clean one.

How to use it

  1. Tick the fields for your columns.
  2. Pick a delimiter: comma (CSV), tab (TSV), semicolon or pipe.
  3. Toggle the header row, quote-every-field, CRLF line endings and the UTF-8 BOM to match — or deliberately mismatch — what your importer expects.
  4. Set the row count (up to 5,000) and download the file.

What you can control

  • Comma, tab, semicolon and pipe delimiters.
  • RFC 4180 quoting: fields containing the delimiter, a quote or a line break are quoted, with embedded quotes doubled — or quote every field.
  • LF or CRLF line endings.
  • An optional UTF-8 byte order mark for Excel.
  • An optional header row.
  • The same thirty-three field types as the JSON and SQL generators, with one coherent person per row.

The CSV properties that break importers

Property What goes wrong
UTF-8 BOM Without it, Excel on Windows shows Zoë instead of Zoë. With it, a naive parser reads the first header as \ufeffid and cannot find the id column.
CRLF line endings Files saved on Windows end each line with \r\n. A parser splitting on \n leaves a stray \r in the last field of every row.
Quoted delimiters "Acme, Inc." is one field. Splitting on commas makes it two and shifts every column after it.
Embedded quotes "He said ""hi""" is valid RFC 4180. Hand-written parsers rarely handle doubled quotes.
Semicolons European Excel exports use ;. An importer that hard-codes , reads every row as a single column.

Generate one file with each property turned on and run them all through your import. The ones that fail are your bug list.

Using it in a test

import csv

FIXTURE = "fixtures/users_bom_crlf.csv"

def test_import_handles_bom_and_crlf(client):
    with open(FIXTURE, newline="", encoding="utf-8-sig") as f:
        expected = list(csv.DictReader(f))
    with open(FIXTURE, "rb") as f:
        response = client.post("/import", files={"file": f})
    assert response.json()["imported"] == len(expected)
    assert response.json()["first"]["id"] == expected[0]["id"]  # not "\ufeffid"

encoding="utf-8-sig" strips the BOM on the Python side; your importer has to do the same.

What this is not

This produces well-formed CSV. To test how your importer handles broken files — truncated rows, unbalanced quotes, mixed encodings — use the malformed data generator.

Questions

How many rows can I generate?

Up to 5,000 rows per file. Generate several files with different seeds and concatenate them (dropping the extra header rows) for larger imports.

Why do accented characters look wrong when I open the CSV in Excel?

Excel on Windows assumes a legacy code page unless the file starts with a UTF-8 byte order mark. Turn on the BOM option and names like Zoë and Müller open correctly. Most other tools ignore the BOM or handle it.

When does a field get quoted?

Following RFC 4180, a field is wrapped in double quotes when it contains the delimiter, a double quote or a line break, and embedded double quotes are doubled. You can also force every field to be quoted.

Should I use commas or semicolons?

Use whatever your consumer expects. In locales that use a comma as the decimal separator — most of continental Europe — Excel saves and expects semicolon-separated files, so testing an import with both is worthwhile.

Is this the same data as the JSON and SQL generators?

Yes. The CSV, JSON and SQL generators share the same thirty-three field types and record builder, so the same seed and fields give you the same records in each format.

Next in Developer

All 11 →