Sample Document Generator.
Generate valid sample documents for testing at the exact size you need, from 1 KB to 100 MB. Choose PDF, DOCX, XLSX, DOC, TXT, Markdown, or XML, set your file size, and download a document built for testing.
Generate document · Copy file URL
File size must be between 1 KB and 100 MB.
Real document structure · Exact byte size · Free · No signup
Generate a Document for Testing
Upload limits, document parsers, previewers, import tools, and storage quotas all depend on file type and file size.
Testfilelab gives you both under control. Choose a document format and target size, and generate a genuine file padded internally to reach the requested byte count.
Use these sample documents for testing when you need to test file uploads, document processing, size limits, previews, imports, parsers, or automated workflows.
Choose a Document Format
Each format generates instantly at any file size
Generate a valid PDF that opens in standard PDF viewers. PDF is a common choice for testing upload limits, document previews, parsers, and processing workflows.
Generate a Word document using the Office Open XML format. Use DOCX files to test Word document uploads, parsing, previews, and document management systems.
Generate an Excel workbook in Office Open XML format. XLSX files are useful for testing spreadsheet imports, previews, uploads, and data-processing workflows.
Generate a file with the legacy .doc extension for older Word upload paths. Check the format notes before using these files for legacy-format validation.
Generate plain-text files at an exact size. TXT is a simple way to test byte limits, streaming, uploads, and text-processing workflows.
Generate Markdown files containing real headings and paragraphs. Use them to test Markdown renderers, editors, content systems, and file uploads.
Generate well-formed XML documents at an exact size. XML files can be used for parser, import, payload, and upload testing.
Popular Document File Sizes
Choose a common test size or generate a document for the exact limit you need.
Popular sizes are useful for testing upload limits, but boundary testing often requires files just below, exactly at, and just above a limit.
Binary vs Decimal Sizes
File-size limits can become confusing when different systems use different definitions of MB.
Testfilelab uses binary units for generated file sizes:
Some storage providers and systems use decimal units instead:
This difference matters when you are testing an exact upload boundary. If your application uses one definition and your test file uses another, a boundary test can produce the wrong result.
Use the file size converter to convert between bytes, KB, MB, and GB before testing a limit.
File size converter
See the same size in binary and decimal units.
- KB
- 10,240
- MB
- 10
- GB
- 0.009766
- kB
- 10,485.76
- MB
- 10.4858
- GB
- 0.010486
What's Inside Each File?
Testfilelab documents are designed to be usable test fixtures, not files with a renamed extension.
| Format | Structure | Content | Best for |
|---|---|---|---|
| Valid PDF document | Sample text and internal padding | Uploads, previews, parsers | |
| DOCX | Office Open XML document | Sample document content | Word uploads and document processing |
| XLSX | Office Open XML workbook | Sample spreadsheet content | Imports, previews and spreadsheet testing |
| DOC | Legacy Word extension | Format-specific test content | Older Word upload paths |
| TXT | Plain text | Text content and size padding | Size and text-processing tests |
| MD | Markdown document | Headings and paragraphs | Editors and Markdown renderers |
| XML | Well-formed XML | Structured XML content | Parsers, imports and payload tests |
The important distinction is that the requested size is achieved within the generated file rather than by simply renaming an unrelated file.
Using Documents in Automated Tests
Sample documents become more useful when they can be fetched consistently during development and testing.
Use a specific file size and format as a repeatable fixture for:
- Upload-limit tests
- File validation tests
- Document parser tests
- Preview and conversion workflows
- Import testing
- API file handling
- Storage and processing pipelines
- CI test fixtures
Every generated file can also be used through its file URL, making it practical to fetch the same test document from scripts and automated workflows.
For document-processing workflows, see the PDF and document processing testing guide →
# URL pattern (size: 1kb to 100mb)
https://www.testfilelab.com/docs/generate/{format}/{size}
# Exactly 10 MB, every time
curl -L -o test-10mb.pdf \
"https://www.testfilelab.com/docs/generate/pdf/10mb"
# A 1 MB spreadsheet for import tests
wget -O import-1mb.xlsx \
"https://www.testfilelab.com/docs/generate/xlsx/1mb"
Frequently Asked Questions
They are generated documents with the internal structure required by their respective formats. They are designed to open in standard software and provide usable files for testing.
Testfilelab builds the document and pads it internally until it reaches the requested byte count.
You can generate documents from 1 KB to 100 MB, using binary file-size units.
Yes. Testfilelab provides stable file URLs that can be fetched from scripts, command-line tools, and automated test workflows.
Generate Your Test Document
Need a specific format and size? Generate the file you need, download it, or use its URL as a repeatable test fixture.