FileExamples

Broken & Edge-Case File Library

A curated collection of intentionally broken and edge-case files for testing parsers, validators, and error handling. Each example includes an explanation of why it fails, expected error behavior, and how to fix it.

16 edge cases6 categoriesFree & educational

Structural Errors

Malformed syntax, missing tags, invalid grammar

JSONerror

JSON with Trailing Comma

A JSON file containing a trailing comma after the last element in an array or object. This is valid in JavaScript but invalid in strict JSON (RFC 8259).

View details
JSONerror

JSON with Single Quotes

A JSON file using single quotes instead of double quotes for strings. This is valid JavaScript syntax but violates the JSON specification.

View details
JSONerror

JSON with Comments

A JSON file containing JavaScript-style comments (// or /* */). Comments are not part of the JSON specification despite being common in config files.

View details
JSONerror

JSON with Unquoted Keys

A JSON file where object keys are not wrapped in double quotes. This is valid in JavaScript but invalid in JSON.

View details
CSVwarning

CSV with Mixed Delimiters

A CSV file that uses both commas and semicolons as delimiters across different rows, causing parsers to misalign columns.

View details
CSVerror

CSV with Inconsistent Column Count

A CSV file where different rows have different numbers of columns, causing import failures and data misalignment.

View details
XMLcritical

XML with Unclosed Tags

An XML file with opening tags that are never closed, violating the well-formedness requirement of XML.

View details
XMLcritical

XML with Mismatched Tags

An XML file where opening and closing tags have different names, violating XML well-formedness rules.

View details
PDFerror

PDF with Broken Cross-Reference Table

A PDF file with a damaged or inconsistent cross-reference (xref) table, causing readers to fail when locating objects within the file.

View details

Why Test with Broken Files?

Robust Error Handling

Discover how your application handles malformed input before your users do. Edge-case testing prevents crashes and data corruption in production.

Security Hardening

Malformed files are a common attack vector. Testing with intentionally broken files helps identify injection points and parser vulnerabilities.

Compliance & QA

Many standards (RFC 8259, RFC 4180, XML 1.0) define strict rules. Edge-case files verify your parser correctly rejects invalid input.