Sample files for parser and importer testing
Well-formed files and deliberate edge cases for testing code that reads CSV, JSON, XML, PDF and more.
A parser is tested by what it is fed. Clean input shows that the common path works; awkward but valid input shows whether the parser follows the format or merely an optimistic idea of it.
The curated library contains files built around the features that hand-written parsers most often mishandle: quoted CSV fields, byte order marks, XML namespaces and CDATA, deeply nested JSON and multipart email.
Recommended files
| File | Size | Why this one | Download |
|---|---|---|---|
| CSV with quoted fields, embedded commas and line breakssample-csv-quoted-fields.csv | 324 B324 bytes | RFC 4180 quoting rules | Download CSV |
| CSV with a UTF-8 byte order mark and non-ASCII textsample-csv-utf8-bom.csv | 193 B193 bytes | Byte order mark | Download CSV |
| Sample product catalogue XML with namespaces and CDATAsample-product-catalog.xml | 1.07 KB1,100 bytes | Namespaces, CDATA and entities | Download XML |
| Nested JSON with every value typesample-nested-config.json | 829 B829 bytes | All JSON types and deep nesting | Download JSON |
| 10 MB CSV samplesample-csv-10mb.csv | 10 MB10,485,760 bytes | Volume test | Download CSV |
| 5 MB JSONL samplesample-jsonl-5mb.jsonl | 5 MB5,242,880 bytes | Streaming test | Download JSONL |
| Sample CSV file with 10,000 rowssample-csv-10000-rows.csv | 818 KB837,484 bytes | Known row count to assert against | Download CSV |
| Sample XLSX with multiple sheets (3 sheets)sample-xlsx-multiple-sheets.xlsx | 8.21 KB8,407 bytes | Three sheets and cross-sheet formulas | Download XLSX |
| Corrupted ZIP file for testing (CRC error)sample-zip-corrupted.zip | 5.19 KB5,316 bytes | Entry that fails its CRC-32 check | Download ZIP |
Checklist
Parse the clean file
Confirm record counts and a few known values. Each download page states how many records a file holds.
Parse the edge cases
Quoted fields, embedded line breaks, a byte order mark, different delimiters, non-ASCII text.
Scale up
Move to 1 MB, then 10 MB. Watch memory as well as time: reading everything at once is the usual fault.
Truncate deliberately
Cut a file in half and check that the parser reports an error instead of returning partial data as if it were complete.
Guides
- How to test corrupted file handling
Truncated PDFs, JPGs and DOCX files, a ZIP with a bad checksum, and what a good failure looks like.
- How to test a CSV import
Byte order marks, quoting, delimiters, row counts and empty files, with the file and expected result for each.
- Building a QA test file kit
The files every tester should keep ready, organised into baseline, boundary and edge-case sets.
- How to test MIME types and file type validation
Extensions, Content-Type headers and magic bytes: how to check that type validation cannot be fooled.
- What is a PDF file? Structure, versions and how to test with one
How a PDF is put together, how to recognise one from its bytes, and what that means for testing.
Related use cases
Frequently asked questions
- How do I make a truncated file?
- Use head -c with a byte count, for example head -c 5000 sample-json-10kb.json > truncated.json. The result is invalid JSON by construction.
Build a fixture for your parser
Create synthetic records with quoted fields, Unicode, missing values or nested JSON. Preview the output and check the actual bytes before downloading.
Test plan architecture and assertion matrix for sample files for parser and importer testing
A thorough file parser testing workflow separates positive functional verification (confirming well-formed inputs succeed and preserve their SHA-256 checksum) from negative boundary verification (confirming oversized, truncated, or mislabelled inputs fail with structured diagnostic codes).
| Test case ID | Scenario in file parser testing | Input fixture | Expected system outcome |
|---|---|---|---|
| TC-FILE-01 | Baseline small payload acceptance | 1 KB – 100 KB valid fixture from Formats | HTTP 200/201; stored byte count and SHA-256 match /checksums.txt |
| TC-FILE-02 | Gateway / reverse-proxy ceiling check | 1 MB, 10 MB, and 20 MB sized fixtures from Sizes | Exact threshold enforced; oversize payload returns HTTP 413 Payload Too Large |
| TC-FILE-03 | Extension vs. magic-byte mismatch | wrong-extension-png-as-jpg.jpg from Broken Files | Validator detects 89 50 4E 47 PNG header and rejects spoofed .jpg extension |
| TC-FILE-04 | Truncated stream / unexpected EOF | Truncated PDF or JPEG from Broken Files | Parser catches missing trailer/EOI marker and returns HTTP 422 without leaking stack traces |
Automating file parser testing in CI/CD pipelines
To keep automated runs deterministic and fast, commit your small sub-100 KB fixtures directly to your repository and synthesize larger 10 MB to 1 GB stress fixtures on demand using our in-browser generator or the reproducible local commands on Methodology. When testing tabular or relational data pipelines during file parser testing, pair binary container checks with our 100-row and 1,000-row synthetic datasets so you can assert exact row counts and column aggregations after ingestion.