Testfilelab

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

Generate & Download

Real document structure · Exact byte size · Free · No signup

PDF 1 MB

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

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:

1 KB1,024 bytes
1 MB1,048,576 bytes

Some storage providers and systems use decimal units instead:

1 MB1,000,000 bytes

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.

Convert file sizes →

File size converter

See the same size in binary and decimal units.

Exact size 10,485,760 bytes
Binary · Testfilelab
KB
10,240
MB
10
GB
0.009766
Decimal
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
PDF 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.

Developer URL patterns
terminal
# 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.