Connect any database. Ask in plain English.

Try free
← Blog

Sample CSV File Download: 9 Free Test Files, 100 to 10,000 Rows, 15 Edge Cases Tested (2026)

Nine free sample CSV files of invented data: orders with 100, 1,000 and 10,000 rows, 1,000 customers, 731 days of metrics, and four test files with quoted commas, line breaks, NULL markers, leading zeros, big integers, a BOM, semicolons and broken rows. We read each with pandas 3.1.2, DuckDB 2.0.1, Python's csv module and PostgreSQL 16 COPY: pandas changed 6 of 15 edge cases without an error, DuckDB 1.

Fastero Dev TeamFastero Dev Team2026-12-03

We wrote a seeded Python script that makes nine CSV files of invented data, published them here, and on 3 December 2026 read every file with pandas 3.1.2, DuckDB 2.0.1, Python 3.14.3's csv module and PostgreSQL 16.15's COPY, each with default settings. We recorded what each did with 15 edge cases and an ambiguous date, measured file sizes up to a million rows and timed the reads. Excel's behaviour comes from Microsoft's documentation, since we couldn't run Excel here.

The short answer: nine sample CSV files are free to download from this page, with no sign-up. Three orders files have 100, 1,000 and 10,000 rows (7 KB, 72 KB and 720 KB, 10 columns), customers.csv has 1,000 rows, daily-metrics.csv has 731 days, and four small files test edge cases: quoting, NULLs, leading zeros, big integers, mixed dates, a byte order mark, semicolons and broken rows. All are UTF-8 with CRLF line ends, as RFC 4180 describes. With default settings, pandas changed 6 of our 15 edge-case checks without an error, Python's csv module 3, DuckDB 1 and PostgreSQL COPY none. The script in this post makes any size you need. Checked 3 December 2026.

Fastero

Connect your database. Ask questions. Get dashboards.

Postgres, BigQuery, Snowflake, and 10+ sources — live-connected, AI-powered, no dashboard builder learning curve.

Try free →

Sample CSV files to download

Every value is invented: customer names are generated labels such as Customer 0001, and emails use example.com, a domain IANA keeps "maintained for documentation purposes". Sizes are in KB of 1,000 bytes.

File Rows Columns Size Use it to test
orders-100.csv 100 10 7.3 KB A first import, a parser's happy path
orders-1000.csv 1,000 10 72 KB Paging, sorting, a first chart
orders-10000.csv 10,000 10 720 KB Dashboards, group-bys, upload limits
customers.csv 1,000 8 81 KB Joins on customer_id, dates, booleans
daily-metrics.csv 731 5 22 KB Time series, line charts, date filters
edge-cases.csv 12 8 742 bytes Quoting, NULLs, zeros, big integers, dates
edge-cases-bom.csv 12 8 745 bytes A UTF-8 byte order mark before the header
edge-cases-semicolon.csv 12 8 742 bytes Semicolon delimiter, decimal commas
malformed.csv 6 3 152 bytes Error paths: extra field, missing field, unclosed quote

Each has a header row; the clean files use ISO 8601 dates, a dot for decimals and no thousands separators. The first lines of three:

order_id,order_date,customer_id,region,product_sku,category,quantity,unit_price,total,status
100001,2025-01-05,552,EMEA,SKU-041,Software,1,32.99,32.99,processing
100002,2025-01-08,34,APAC,SKU-015,Accessories,2,32.99,65.98,delivered
 
customer_id,name,email,signup_date,country,region,segment,is_active
1,Customer 0001,customer0001@example.com,2022-01-28,DE,EMEA,Consumer,true
 
date,visits,signups,orders,revenue
2024-01-01,1194,32,14,810.71

What's in the orders, customers and daily-metrics files

Orders cover 2025, one row each: id, date, customer, region, one of 50 products in four categories, quantity, unit price, total and status. In orders-10000.csv, 999 of the 1,000 customers appear, 71% of orders are delivered and the totals come to $3.64 million. Every customer_id exists in customers.csv with the same region, so a join keeps every row.

Customers: id, generated name and email, 2022-2024 signup date, one of ten country codes, region (Americas 466, EMEA 318, APAC 216), segment and a true/false is_active.

Daily metrics run from 1 January 2024 to 31 December 2025: visits (727 to 2,746 a day), signups, orders and revenue, with a weekday rhythm and a steady climb.

Bar chart of orders per month in orders-10000.csv: 730 in January, 585 in February, then 710 to 857 through September, 986 in October, 1,036 in November and 1,320 in December

Orders per month in orders-10000.csv, counted with DuckDB 2.0.1 on 3 December 2026. All values are invented.

The edge-case CSV file, row by row

edge-cases.csv follows RFC 4180, so a parser that changes it is interpreting, not recovering. Its columns are id, case, text, zip, big_int, qty, amount and event_date, with a different trap in each row:

Row Case Text field as written Also in this row
1 plain plain text big_int 9007199254740993 (2^53 + 1), date 2026-03-14
2 comma "Widgets, large" int64 maximum, US date 03/14/2026
3 quotes "He said ""ship it""" int64 minimum, day-first 14/03/2026
4 newline a line feed inside quotes ambiguous 04/03/2026
5 crlf a CR LF pair inside quotes 4000000000, past a 32-bit int; 14.03.2026
6 spaces padded , unquoted 2026-03-14T09:30:00Z
7 unicode "Café déjà vu, 5 €, 日本語 😀" 15 digits; "March 14, 2026"
8 empty every field after case is empty
9 quoted empty "" 16 digits; 20260314
10 word NULL NULL 14-Mar-2026
11 word NA NA 2026/03/14
12 backslash N \N 3/14/26

Every zip has five digits, many with a leading 0. The variants:

  • edge-cases-bom.csv adds a UTF-8 byte order mark, the bytes EF BB BF, in front.
  • edge-cases-semicolon.csv uses ; between fields and decimal commas (19,99), like a European Excel export.
  • malformed.csv has an extra field in row 2, a missing one in row 3, bare quotes in row 4 and a quote that never closes in row 5.

How pandas, DuckDB, Python's csv and PostgreSQL COPY read it

We read each file as most people first would: pd.read_csv(path), SELECT * FROM read_csv(path), csv.reader with newline="" and UTF-8 as Python's docs advise, and COPY ... WITH (FORMAT csv, HEADER true) into text columns, since COPY infers no types:

Check pandas 3.1.2 DuckDB 2.0.1 csv module PostgreSQL COPY
Comma, doubled quotes, LF and CRLF inside quotes Kept Kept Kept Kept
Leading and trailing spaces; UTF-8 text Kept Kept Kept Kept
Empty field vs quoted "" Both NaN Both NULL Both '' NULL vs ''
The words NULL and NA NaN Kept as text Kept Kept
\N Kept Kept Kept Kept as text in CSV mode
Leading zeros in zip Lost: float64, 2134.0 Kept: VARCHAR Kept Kept (text column)
Integers past 2^53 Rounded: float64 Exact: BIGINT Exact, as text Exact in bigint
Integer column with one blank Became float64 BIGINT with a NULL Text int with a NULL
Mixed date formats Left as text Left as VARCHAR Text date column: error, 0 rows
UTF-8 BOM Stripped Stripped Kept: \ufeffid Skipped with HEADER true
Semicolon file ParserError Detected; amount VARCHAR Garbled rows, no error Error
malformed.csv ParserError, line 3 One column, no error Ragged rows, no error Error, line 3

Counting each quoting case, spaces, UTF-8, NULL and NA apart, and leaving out mixed dates and malformed.csv, that is 15 checks:

Stacked bar chart of 15 edge-case checks read with default settings: DuckDB read 14 as written and changed 1; PostgreSQL COPY read 14 as written and stopped with an error on 1; Python's csv module read 12 as written and changed 3; pandas read 8 as written, changed 6 and stopped with an error on 1

Edge-case checks per reader, measured 3 December 2026 on edge-cases.csv and its BOM and semicolon copies.

This isn't a quality ranking: COPY and the csv module infer no types, so they rarely change a value, and every change pandas made came from type inference.

pandas made the zips floats, rounded the big integers, turned qty into floats over one blank and read NULL and NA as missing:

import pandas as pd
 
df = pd.read_csv("edge-cases.csv")
print(df.dtypes.to_string())
print(df.loc[[0, 8, 9, 10], ["case", "text", "zip", "qty"]].to_string())
print(int(df.big_int[0]), int(df.big_int[1]))  # file: 9007199254740993, int64 max
id              int64
case              str
text              str
zip           float64
big_int       float64
qty           float64
amount        float64
event_date        str
            case        text      zip  qty
0          plain  plain text   2134.0  1.0
8   quoted empty         NaN  60601.0  2.0
9      word NULL         NaN   2134.0  3.0
10       word NA         NaN  33101.0  1.0
9007199254740992 9223372036854775808

The second number is one more than the largest int64. In a separate test, a column with a value past int64 and a blank stayed text, the blank as an empty string, not missing.

DuckDB kept the zips as text, read big_int as an exact BIGINT, and only merged the empty field with "", because its allow_quoted_nulls option is on by default:

import duckdb
 
duckdb.sql("""
    SELECT column_name, column_type
    FROM (DESCRIBE SELECT * FROM read_csv('edge-cases.csv'))
""").show()
duckdb.sql("""
    SELECT "case", text, text IS NULL AS is_null, zip, big_int
    FROM read_csv('edge-cases.csv') WHERE id IN (1, 2, 8, 9, 10)
""").show()
┌─────────────┬─────────────┐
│ column_name │ column_type │
│   varchar   │   varchar   │
├─────────────┼─────────────┤
│ id          │ BIGINT      │
│ case        │ VARCHAR     │
│ text        │ VARCHAR     │
│ zip         │ VARCHAR     │
│ big_int     │ BIGINT      │
│ qty         │ BIGINT      │
│ amount      │ DOUBLE      │
│ event_date  │ VARCHAR     │
└─────────────┴─────────────┘
 
┌──────────────┬────────────────┬─────────┬─────────┬─────────────────────┐
│     case     │      text      │ is_null │   zip   │       big_int       │
│   varchar    │    varchar     │ boolean │ varchar │        int64        │
├──────────────┼────────────────┼─────────┼─────────┼─────────────────────┤
│ plain        │ plain text     │ false   │ 02134   │    9007199254740993 │
│ comma        │ Widgets, large │ false   │ 00501   │ 9223372036854775807 │
│ empty        │ NULL           │ true    │ NULL    │                NULL │
│ quoted empty │ NULL           │ true    │ 60601   │    1234567890123456 │
│ word NULL    │ NULL           │ false   │ 02134   │                  42 │
└──────────────┴────────────────┴─────────┴─────────┴─────────────────────┘

Where DuckDB should have complained and didn't was malformed.csv: finding no consistent delimiter, it returned six rows of one column named id,name,amount. Given delim = ',' it raised an error instead, and with ignore_errors = true it skipped the two ragged rows.

PostgreSQL COPY alone kept an empty field and "" apart. Its docs explain: "The CSV format has no standard way to distinguish a NULL value from an empty string." Into typed columns one bad value fails the load, since "COPY stops operation at the first error." In psql on the postgres:16-alpine image:

CREATE TABLE edge (id text, "case" text, text text, zip text, big_int text,
                   qty text, amount text, event_date text);
COPY edge FROM '/data/edge-cases.csv' WITH (FORMAT csv, HEADER true);
SELECT "case", text IS NULL AS is_null, length(text) AS len, zip
FROM edge WHERE id IN ('8', '9', '10', '12');
 
CREATE TABLE edge_typed (id int, "case" text, text text, zip text,
                         big_int bigint, qty int, amount numeric, event_date date);
COPY edge_typed FROM '/data/edge-cases.csv' WITH (FORMAT csv, HEADER true);
COPY edge FROM '/data/edge-cases-bom.csv' WITH (FORMAT csv, HEADER match);
COPY edge FROM '/data/edge-cases-semicolon.csv' WITH (FORMAT csv, HEADER true);
COPY 12
     case     | is_null | len |  zip
--------------+---------+-----+-------
 empty        | t       |     |
 quoted empty | f       |   0 | 60601
 word NULL    | f       |   4 | 02134
 backslash N  | f       |   2 | 00544
(4 rows)
 
ERROR:  date/time field value out of range: "14/03/2026"
HINT:  Perhaps you need a different "datestyle" setting.
CONTEXT:  COPY edge_typed, line 4, column event_date: "14/03/2026"
ERROR:  column name mismatch in header line field 1: got "\ufeffid", expected "id"
CONTEXT:  COPY edge, line 1: "\ufeffid,case,text,zip,big_int,qty,amount,event_date"
ERROR:  missing data for column "text"
CONTEXT:  COPY edge, line 2: "1;plain;plain text;02134;9007199254740993;1;19,99;2026-03-14"

psql printed the byte order mark invisibly; we wrote it as \ufeff. HEADER true discards the first line, BOM and all, so that load works. PostgreSQL 17's ON_ERROR ignore will "discard the input row and continue with the next one"; 16 has no such option. With DELIMITER ';' the semicolon file loads, but 19,99 isn't a valid numeric, so amounts stay text.

Python's csv module returns strings and never guesses a type, but two defaults catch people:

import csv
 
with open("edge-cases-bom.csv", newline="", encoding="utf-8") as f:
    print(next(csv.reader(f))[:3])
with open("edge-cases-bom.csv", newline="", encoding="utf-8-sig") as f:
    print(next(csv.reader(f))[:3])
with open("edge-cases.csv", encoding="utf-8") as f:  # no newline=""
    print(repr(list(csv.reader(f))[5][2]))
with open("edge-cases.csv", newline="") as f:  # no encoding, on Windows
    print(list(csv.reader(f))[7][2])
['\ufeffid', 'case', 'text']
['id', 'case', 'text']
'line one\nline two'
Café déjà vu, 5 €, 日本語 😀

Without newline="", row 5's CR LF came back as a bare line feed, as the docs warn: "If newline='' is not specified, newlines embedded inside quoted fields will not be interpreted correctly". Without an encoding, Python 3.14 on Windows used cp1252 and garbled the text silently; Python 3.15 defaults to UTF-8 under PEP 686, which we didn't test. The semicolon file came back as 15 ragged rows, though csv.Sniffer detected the semicolon.

Which date is 01/02/2026?

The same column of 01/02/2026 and 03/04/2026 came back as different dates:

Reader 01/02/2026 becomes Why
pandas 3.1.2, parse_dates 2 January 2026 Month first
DuckDB 2.0.1 read_csv 1 February 2026 Its sniffer picked %d/%m/%Y
PostgreSQL 16, DateStyle ISO, MDY (default) 2 January 2026 Month first
PostgreSQL 16, DateStyle ISO, DMY 1 February 2026 Day first
Excel (documented) Set by regional settings See below
from pathlib import Path
 
import duckdb
import pandas as pd
 
Path("dates.csv").write_text("d\n01/02/2026\n03/04/2026\n")
print(pd.read_csv("dates.csv", parse_dates=["d"])["d"].dt.date.tolist())
print(duckdb.sql("SELECT d FROM read_csv('dates.csv')").fetchall())
print(duckdb.sql("SELECT DateFormat FROM sniff_csv('dates.csv')").fetchall())
[datetime.date(2026, 1, 2), datetime.date(2026, 3, 4)]
[(datetime.date(2026, 2, 1),), (datetime.date(2026, 4, 3),)]
[('%d/%m/%Y',)]

DuckDB's docs list day-first formats above month-first and say "Higher entries are chosen over lower entries in case of ambiguities (i.e., ISO 8601 is preferred over MM-DD-YYYY)." Given 02/13/2026, it switched the column to month-first. Given 13/02/2026, pandas left the column as text without an error, as its docs say it will. On the edge file's twelve formats, format="mixed" in pd.to_datetime parsed them all, reading 04/03/2026 as 3 April but 14/03/2026 as 14 March.

What Excel does with a CSV (documented, not tested)

From Microsoft's documentation, read 3 December 2026; we couldn't run Excel.

  • Leading zeros and long numbers. "Excel automatically removes leading zeros, and converts large numbers to scientific notation, like 1.23E+15, in order to allow formulas and math operations to work on them." It keeps 15 digits, so by that rule 9007199254740993 becomes 9007199254740990.
  • Switching that off. Excel for Microsoft 365 and 2024 can, for a .csv file too: File > Options > Data > Automatic Data Conversion (Excel > Preferences > Edit on a Mac).
  • Dates. "When Excel opens a .csv file, it uses the current default data format settings to interpret how to import each column of data."
  • The BOM. "You can open a CSV file encoded with UTF-8 normally if it was saved with BOM (Byte Order Mark)." Double-click edge-cases-bom.csv; open the others with Data > Get Data > From Text/CSV.
  • Semicolons. Excel saves CSV with Windows' list separator, and a comma decimal separator "forces Excel to use a semi-colon for the list separator".

The CSV format rules: RFC 4180, quoted

RFC 4180, from October 2005, is the nearest thing CSV has to a standard, though "It does not specify an Internet standard of any kind." Its rules:

  1. "Each record is located on a separate line, delimited by a line break (CRLF)."
  2. "The last record in the file may or may not have an ending line break."
  3. "There maybe an optional header line appearing as the first line of the file with the same format as normal record lines."
  4. "Each line should contain the same number of fields throughout the file. Spaces are considered part of a field and should not be ignored."
  5. "If fields are not enclosed with double quotes, then double quotes may not appear inside the fields."
  6. "Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes."
  7. "If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote."

Its grammar allows only printable ASCII, so UTF-8 rests on the charset parameter of the text/csv type it registers, and it has no NULL. It concedes: "Due to lack of a single specification, there are considerable differences among implementations." Our clean files and edge-cases.csv follow all seven rules; the semicolon copy and malformed.csv break them on purpose.

How to read a CSV without changing your data

  1. Set types yourself. In pandas, read codes as text and integers as nullable Int64, and turn off the default NA words.
  2. Name the decimal mark for European files: decimal = ',' in pandas, decimal_separator = ',' in DuckDB.
  3. Open with utf-8-sig in Python's csv module; it reads files with or without a BOM.
  4. In PostgreSQL, load text columns first, then cast, testing values with pg_input_is_valid().
  5. Name the date format, or write ISO 8601 dates.
import duckdb
import pandas as pd
 
df = pd.read_csv("edge-cases.csv", keep_default_na=False, na_values=[""],
                 dtype={"zip": "str", "big_int": "Int64", "qty": "Int64"})
print(df.dtypes[["text", "zip", "big_int", "qty"]].to_string())
print(df.loc[[0, 1, 7, 9], ["case", "text", "zip", "big_int", "qty"]].to_string())
 
semi = duckdb.sql("""SELECT amount FROM read_csv('edge-cases-semicolon.csv',
                     decimal_separator = ',')""")
print(semi.types, semi.fetchall()[:3])
text         str
zip          str
big_int    Int64
qty        Int64
        case            text    zip              big_int   qty
0      plain      plain text  02134     9007199254740993     1
1      comma  Widgets, large  00501  9223372036854775807     2
7      empty             NaN    NaN                 <NA>  <NA>
9  word NULL            NULL  02134                   42     3
[DOUBLE] [(19.99,), (5.0,), (1234.5,)]

The zeros, exact integers and the word NULL survive. For files too big for memory, see reading large CSVs in pandas; for SQL on files, querying CSV and Excel with DuckDB and joining a CSV to a database table.

How big is a CSV file with a million rows?

At about 72 bytes a row, a million orders is 72.1 MB. Gzip shrinks it to 9.4 MB and Parquet, written by DuckDB with its default Snappy compression, to 9.1 MB; at 100 rows gzip is smaller:

Line chart on log scales of the orders file's size by row count: as CSV 7 KB at 100 rows, 72 KB at 1,000, 720 KB at 10,000, 7.2 MB at 100,000 and 72.1 MB at 1 million; gzipped CSV 1.7 KB at 100 rows and 9.4 MB at a million; Parquet 4.5 KB at 100 rows and 9.1 MB at a million

Orders files made by the script in this post, measured 3 December 2026: gzip level 6, Parquet from DuckDB 2.0.1 with default settings.

Read times below are medians of 15 runs (5 for a million rows) after a warm-up, from the quietest of our sessions. Other jobs shared the laptop's CPU, and in the busiest session the same reads took up to six times longer, so compare the readers with each other rather than with your machine.

Reader orders-10000.csv (720 KB) 1 million rows (72 MB)
pandas read_csv 14 ms 0.80 s
csv.reader into a list 32 ms 3.1 s
PostgreSQL COPY into a typed table 34 ms 1.9 s
csv.DictReader into a list 82 ms 8.9 s
DuckDB read_csv into a table 136 ms 1.2 s
DuckDB read_csv to a pandas DataFrame 232 ms 1.1 s

On the small file DuckDB's time was mostly type detection: the sniffer alone took 75 ms, and a count with the columns spelled out took 11 ms against 166 ms with detection.

Connect any database. Ask in plain English.

Start free →

Make your own sample CSV with Python

This is the whole script that made the files, standard library only. Every random number comes from random.Random(42).random(), because Python promises "The generator's random() method will continue to produce the same sequence when the compatible seeder is given the same seed." Its other methods may change between versions.

"""Write the sample CSV files from fastero.com/blog/sample-csv-file.
 
Every value is invented. The same command gives the same files: the script draws
only from random.Random(seed).random(), the method Python keeps stable across versions.
Usage: python make_sample_csv.py [--out DIR] [--seed 42] [--rows 100 1000 10000]
"""
import argparse
import csv
import datetime as dt
import random
from pathlib import Path
 
ap = argparse.ArgumentParser()
ap.add_argument("--out", default="sample-csv")
ap.add_argument("--seed", type=int, default=42)
ap.add_argument("--rows", type=int, nargs="+", default=[100, 1000, 10000])
args = ap.parse_args()
out = Path(args.out)
out.mkdir(parents=True, exist_ok=True)
r = random.Random(args.seed).random
 
 
def pick(options, weights=None):
    """Weighted choice built on r() alone, so it can't change between versions."""
    weights = weights or [1] * len(options)
    x = r() * sum(weights)
    for option, w in zip(options, weights):
        x -= w
        if x < 0:
            return option
    return options[-1]
 
 
def write(name, header, rows):
    with open(out / name, "w", newline="", encoding="utf-8") as f:
        w = csv.writer(f)  # RFC 4180 style: CRLF line ends, quotes only when needed
        w.writerow(header)
        w.writerows(rows)
 
 
# customers.csv: 1,000 customers with generated labels, signed up 2022-2024
REGION = {"US": "Americas", "CA": "Americas", "BR": "Americas", "MX": "Americas",
          "GB": "EMEA", "DE": "EMEA", "FR": "EMEA",
          "IN": "APAC", "JP": "APAC", "AU": "APAC"}
customers = []
for i in range(1, 1001):
    country = pick(list(REGION), [30, 8, 6, 4, 12, 10, 8, 10, 6, 6])
    signup = dt.date(2022, 1, 1) + dt.timedelta(days=int(r() * 1096))
    customers.append([i, f"Customer {i:04d}", f"customer{i:04d}@example.com",
                      signup.isoformat(), country, REGION[country],
                      pick(["Consumer", "Small business", "Enterprise"], [6, 3, 1]),
                      pick(["true", "false"], [85, 15])])
write("customers.csv", ["customer_id", "name", "email", "signup_date", "country",
                        "region", "segment", "is_active"], customers)
 
# orders-N.csv: N orders in 2025 from those customers, 50 products in 4 categories
CATEGORY = {"Hardware": (20, 250), "Software": (10, 100), "Services": (100, 900),
            "Accessories": (5, 40)}
products = []
for n in range(1, 51):
    cat = list(CATEGORY)[n % 4]
    lo, hi = CATEGORY[cat]
    products.append((f"SKU-{n:03d}", cat, int(lo + r() * (hi - lo)) + 0.99))
BUSY = [0.8, 0.8, 0.9, 0.9, 1.0, 1.0, 0.9, 0.9, 1.0, 1.1, 1.4, 1.6]  # by month
 
 
def order_day():
    while True:  # busier in November and December, quieter at weekends
        d = dt.date(2025, 1, 1) + dt.timedelta(days=int(r() * 365))
        if r() * 1.6 < BUSY[d.month - 1] * (0.7 if d.weekday() >= 5 else 1.0):
            return d
 
 
for n in args.rows:
    rows = []
    for k, day in enumerate(sorted(order_day() for _ in range(n))):
        c = customers[int(r() ** 2 * len(customers))]  # early customers order more
        sku, cat, price = pick(products)
        qty = pick([1, 2, 3, 4, 5], [50, 25, 12, 8, 5])
        status = pick(["delivered", "shipped", "processing", "cancelled", "returned"],
                      [72, 12, 5, 7, 4])
        rows.append([100001 + k, day.isoformat(), c[0], c[5], sku, cat, qty, price,
                     round(qty * price, 2), status])
    write(f"orders-{n}.csv", ["order_id", "order_date", "customer_id", "region",
                              "product_sku", "category", "quantity", "unit_price",
                              "total", "status"], rows)
 
# daily-metrics.csv: 731 days of visits, signups, orders and revenue
rows, day = [], dt.date(2024, 1, 1)
while day.year < 2026:
    t = (day - dt.date(2024, 1, 1)).days
    week = [1.0, 1.05, 1.05, 1.0, 0.95, 0.7, 0.65][day.weekday()]
    visits = int((1200 + 1.5 * t) * week * (0.85 + 0.3 * r()))
    signups = int(visits * (0.02 + 0.01 * r()))
    orders = int(signups * (0.3 + 0.2 * r()))
    rows.append([day.isoformat(), visits, signups, orders,
                 round(orders * (40 + 30 * r()), 2)])
    day += dt.timedelta(days=1)
write("daily-metrics.csv", ["date", "visits", "signups", "orders", "revenue"], rows)
 
# edge-cases*.csv: one row per trap. Each field is written exactly as listed here,
# quotes included, so this list is the file. 8 columns, 12 rows, CRLF line ends.
EDGE = [
    ["id", "case", "text", "zip", "big_int", "qty", "amount", "event_date"],
    ["1", "plain", "plain text", "02134", "9007199254740993", "1", "19.99",
     "2026-03-14"],
    ["2", "comma", '"Widgets, large"', "00501", "9223372036854775807", "2", "5.00",
     "03/14/2026"],
    ["3", "quotes", '"He said ""ship it"""', "07030", "-9223372036854775808", "3",
     "1234.50", "14/03/2026"],
    ["4", "newline", '"line one\nline two"', "10001", "1", "1", "0.10", "04/03/2026"],
    ["5", "crlf", '"line one\r\nline two"', "94105", "4000000000", "2", "-7.25",
     "14.03.2026"],
    ["6", "spaces", "  padded  ", "08540", "0", "3", "1000", "2026-03-14T09:30:00Z"],
    ["7", "unicode", '"Café déjà vu, 5 €, 日本語 😀"', "01002", "123456789012345",
     "1", "3.14159", '"March 14, 2026"'],
    ["8", "empty", "", "", "", "", "", ""],
    ["9", "quoted empty", '""', "60601", "1234567890123456", "2", "0.00", "20260314"],
    ["10", "word NULL", "NULL", "02134", "42", "3", "99.95", "14-Mar-2026"],
    ["11", "word NA", "NA", "33101", "7", "1", "12.5", "2026/03/14"],
    ["12", "backslash N", "\\N", "00544", "99", "2", "7", "3/14/26"],
]
 
 
def edge(name, sep=",", decimal=".", bom=""):
    lines = [sep.join(f[:6] + [f[6].replace(".", decimal)] + f[7:]) for f in EDGE]
    text = bom + "\r\n".join(lines) + "\r\n"
    (out / name).write_text(text, encoding="utf-8", newline="")
 
 
edge("edge-cases.csv")
edge("edge-cases-bom.csv", bom="\ufeff")  # UTF-8 byte order mark first
edge("edge-cases-semicolon.csv", sep=";", decimal=",")  # a European-style export
 
# malformed.csv: breaks the rules on purpose, to test an importer's error path
BAD = ["id,name,amount", "1,ok row,10.00", "2,extra field,20.00,surprise",
       "3,missing field", '4,bare "quotes" inside,40.00', '5,"unclosed quote,50.00',
       "6,last row,60.00"]
(out / "malformed.csv").write_text("\r\n".join(BAD) + "\r\n", encoding="utf-8",
                                   newline="")
for f in sorted(out.glob("*.csv")):
    print(f"{f.name:26} {f.stat().st_size:>9,} bytes")

Run with Python 3.14.3, it printed this, and two runs gave byte-identical files:

python make_sample_csv.py --out sample-csv
customers.csv                 80,999 bytes
daily-metrics.csv             21,925 bytes
edge-cases-bom.csv               745 bytes
edge-cases-semicolon.csv         742 bytes
edge-cases.csv                   742 bytes
malformed.csv                    152 bytes
orders-100.csv                 7,305 bytes
orders-1000.csv               72,084 bytes
orders-10000.csv             720,175 bytes

For bigger files, list the sizes: --rows 100 1000 10000 100000 1000000 took 51 seconds here and wrote the 72.1 MB file above, with the first three identical to the published ones. A lone --rows 1000000 gives a different, equally valid million rows.

Other places to download sample CSV files

Source What it has Size or limit Best for
Datablist Customers, people, organizations, leads, products, plus broken files 100 to 2 million rows CRM-style imports with realistic-looking names
Mockaroo Data generated from a schema you design Free: 1,000 rows a file; $60 a year: 100,000; $500: 10 million Custom columns without code
Faker (Python) A library that generates names, addresses, text Unlimited, on your machine Realistic fakes in your own script
John Burkardt's CSV page (FSU) Small classic files, LGPL 1 to 10,000 records Tiny parser tests

Datablist says "Most rows are synthetic and those files must only be used for testing." Its broken files (Windows-1252, mixed delimiters, duplicate headers and more) go further than ours. For real data, see free datasets; for databases to practice SQL on, sample databases.

Where Fastero fits

After a file parses, the next job is usually a query, a chart or a dashboard. Fastero is an AI and data platform where people and AI agents work together on a team's data, in the browser on a Mac, Windows or Linux. On the Free plan, with no end date and no card:

  • Upload a CSV to a project, up to 100 MB a file within the plan's 500 MB of storage, then query it with SQL, chart it, or read it from a notebook by path. Even the script's 72 MB million-row file fits.
  • Ask the AI chat about up to 10 files at a time, 50 MB each, paid from the $20 of AI usage every account starts with. It writes and runs the SQL and can build a dashboard.
  • Try it with no file: every new account has an invented sales table of made-up orders to query in the SQL editor straight away.

We haven't tested how Fastero's upload reads the edge-case files, so we make no claim about them. Plans: pricing.

FAQ

How do I create a CSV file with 1 million rows?

Run the script in this post with --rows 1000000. It needs only Python's standard library; our run that included a million rows took 51 seconds and wrote 72.1 MB, and the same seed always gives the same file. Faker, or DuckDB's COPY ... TO, are other ways.

Why does pandas remove leading zeros from my CSV?

Because read_csv infers types, and digits become a number: our 02134 came back as 2134.0. Read such columns with dtype={"zip": "str"}. DuckDB 2.0.1 kept the zeros by default.

Why does Excel change numbers and dates when I open a CSV?

Per Microsoft's docs, Excel converts data as it opens a .csv file: it drops leading zeros, keeps 15 significant digits and reads dates by your regional settings. Excel for Microsoft 365 and 2024 can turn the first two off under Automatic Data Conversion.

What is the correct format for a CSV file?

RFC 4180 describes the common one: records separated by CRLF, an optional header, the same number of fields on every line, and fields with commas, quotes or line breaks wrapped in double quotes, inner quotes doubled. It is informational, not a formal standard, so tools differ.

How do you represent NULL in a CSV file?

CSV has no NULL. PostgreSQL's COPY reads an unquoted empty field as NULL and "" as an empty string; pandas reads both, plus words such as NULL and NA, as missing; DuckDB reads both empty forms as NULL. Pick a convention and set it when you read, with na_values in pandas or nullstr in DuckDB.

Sources

Read on 3 December 2026.

Standards and documentation

Microsoft Support (Excel)

Other sample data

Our measurement: Windows 11, Python 3.14.3, pandas 3.1.2, DuckDB 2.0.1, PostgreSQL 16.15 (postgres:16-alpine in Docker), seed 42.


Try Fastero free: upload orders-10000.csv to a project, then query it with SQL, chart it or ask the AI chat about it. No credit card required.

Ready to try it yourself?

Connect your database, ask questions in plain English, and get live dashboards — in under 2 minutes. No credit card required.

Follow Fastero on LinkedIn for new articles and examples.