Blog
How to Create a Test File of Any Size
Learn how to create exact-size test files for upload limits, API testing, email attachments, storage checks and QA workflows.
Creating a test file of a specific size is useful when you need to check upload limits, validate an API, test an email attachment rule or reproduce a storage-related issue. Instead of searching for a random file that happens to be close to the required size, you can generate one with the exact format and byte count you need.
ByteRivet lets you create test files directly in your browser. You can choose a format, enter an exact size and generate a file without uploading personal content or modifying an existing document.
This guide explains how test files work, why exact file size matters and which formats are suitable for different testing scenarios.
What Is a Test File?
A test file is a file created for software testing rather than for storing important personal or business information.
It may contain placeholder data, a valid file structure or a predefined number of bytes. Developers, quality assurance teams, website owners and system administrators commonly use test files to check how an application behaves under specific conditions.
A test file can be used to test:
- File upload limits
- Form validation
- API request size restrictions
- Email attachment limits
- Cloud storage behavior
- Download performance
- Progress indicators
- Timeout handling
- File type validation
- Error messages
For example, a website may allow files up to 10 MB. A tester can use files slightly below, exactly at and slightly above that limit to verify whether the validation behaves correctly.
How to Create a Test File of Any Size
You can create a test file with ByteRivet in a few steps:
1. Open the ByteRivet test file generator.
2. Select a file family such as Documents, Images, Data, Media or Archives.
3. Choose the required format.
4. Enter a size using bytes, KB, MB, MiB, GB or another supported unit.
5. Review the exact byte value.
6. Select Generate file.
7. Save the generated file to your device.
The selected unit matters. A 10 MB file and a 10 MiB file do not contain the same number of bytes.
- 10 MB equals 10,000,000 bytes.
- 10 MiB equals 10,485,760 bytes.
Using an exact byte value is the safest option when a test requires strict precision.
Why Exact File Size Matters
A file described as “about 10 MB” may not be suitable for testing a hard upload limit. Its actual size may be slightly smaller or larger depending on how it was created, compressed or measured.
Exact size becomes important in boundary testing.
Suppose an application has a maximum upload size of 10,000,000 bytes. A useful test set would include:
- 9,999,999 bytes
- 10,000,000 bytes
- 10,000,001 bytes
These three files help confirm whether the application:
- Accepts files below the limit
- Correctly handles a file at the exact limit
- Rejects files above the limit
- Displays an understandable error message
- Avoids beginning an upload that cannot be completed
Testing only one random file does not provide the same level of confidence.
Common Uses for Test Files
Upload limit testing
Upload forms often restrict files by size, extension or MIME type. Test files help verify whether those rules work both in the browser and on the server.
Client-side validation alone is not enough. A reliable application should also validate the file after it reaches the server.
API testing
APIs may limit the size of multipart uploads, request bodies or encoded file content. Exact-size files make it easier to test:
- Maximum request body size
- Timeout behavior
- Retry logic
- Progress reporting
- Server error responses
- Reverse proxy limits
Email attachment testing
Email services and contact forms commonly enforce attachment limits. A generated test file can be used to check whether an attachment is accepted, rejected or compressed.
Remember that email encoding may increase the transmitted size beyond the original file size.
Storage testing
Test files can help evaluate:
- Available disk space
- Quota enforcement
- Cloud storage limits
- File synchronization
- Backup behavior
- Transfer speed
Large test files can also reveal how an application behaves when storage is nearly full.
Quality assurance workflows
QA teams frequently need repeatable test data. Generating files with known sizes and formats makes it easier to document test cases and reproduce bugs.
A report can specify the exact format and byte count instead of referring to an unknown file from a tester’s computer.
Choosing the Right File Format
The correct format depends on what you are testing — browse the full list of supported formats.
Use a PDF test file when testing document uploads, preview systems, document management tools or attachment workflows.
A structurally valid PDF is more useful than simply renaming a random binary file with a .pdf extension.
JPG, PNG and WebP
Image test files are suitable for:
- Image upload limits
- Thumbnail generation
- Compression tools
- Media libraries
- Profile photo forms
- Content management systems
File size and image dimensions are separate properties. Two images with the same dimensions can have very different file sizes.
ZIP
ZIP files are useful for testing archive uploads, backup tools, extraction services and security controls.
A large ZIP file may also be used to check whether an application displays extraction errors or handles compressed content safely.
CSV
CSV files are useful for import testing, spreadsheet workflows and bulk data tools.
When testing CSV imports, file size is only one factor. You may also need to test:
- Number of rows
- Character encoding
- Delimiters
- Quoted values
- Empty columns
- Invalid records
JSON and XML
JSON and XML files are commonly used for API, import and structured-data testing.
They are useful when checking parser limits, payload validation and error handling. A valid structured file is generally more representative than a file containing only random bytes.
TXT
TXT files are simple and widely supported. They are useful for general upload testing when the application does not require a complex file structure.
BIN
A BIN file is suitable when only the exact byte size matters. It is often useful for bandwidth, storage and raw upload testing.
Popular Test File Sizes
Different systems require different test sizes. Common examples include:
1 MB test file
Useful for basic form validation, small upload tests and quick transfer checks.
5 MB test file
Often used for contact forms, image upload systems and standard attachment testing.
10 MB test file
A common boundary for website uploads, email attachments and API requests.
25 MB test file
Useful for testing larger attachments, cloud services and document management platforms.
100 MB test file
Suitable for storage, transfer speed, progress bar and timeout testing.
The best size depends on the system being tested. For boundary testing, create files immediately below, exactly at and immediately above the configured limit.
MB vs MiB: Why the Displayed Size May Differ
File size units are not always interpreted in the same way.
Decimal units use powers of 1,000:
- 1 KB = 1,000 bytes
- 1 MB = 1,000,000 bytes
- 1 GB = 1,000,000,000 bytes
Binary units use powers of 1,024:
- 1 KiB = 1,024 bytes
- 1 MiB = 1,048,576 bytes
- 1 GiB = 1,073,741,824 bytes
Some operating systems display binary quantities while labeling them as KB, MB or GB. Because of this, a file created as exactly 10 MB may appear differently depending on the application used to inspect it.
When precision matters, compare the exact byte count rather than relying only on the rounded value shown by a file manager.
Can You Create a Valid File at Any Size?
Not every format can be created at every possible size.
Structured formats require a minimum number of bytes for headers, metadata, internal tables or end markers. A valid PDF, ZIP or image file cannot be smaller than the minimum structure required by that format.
If the requested size is below the format minimum, the generator should either:
- Explain the minimum supported size
- Suggest a larger value
- Offer a raw format such as BIN or TXT
Larger files can usually be created by adding valid padding, additional data or format-compatible content.
Are Generated Test Files Safe?
A test file should not contain personal, confidential or production data.
For safer testing:
- Generate files specifically for the test
- Avoid uploading real customer documents
- Do not include passwords or API keys
- Confirm whether a tool processes files locally or on a server
- Delete temporary files after testing
- Use isolated testing environments when possible
ByteRivet’s test file generator creates files in the browser, so the generation process does not require uploading an existing personal file.
Test Files and MIME Type Validation
A file extension alone does not prove the real file type.
For example, renaming sample.txt to sample.pdf does not create a valid PDF. Applications may inspect:
- File extension
- MIME type
- File signature
- Internal structure
- Metadata
When testing file type validation, use a structurally valid file in the intended format. You can also create separate negative test cases using mismatched extensions and file signatures.
A Practical Upload Test Checklist
Use the following checklist when testing an upload feature:
- Test a supported format
- Test an unsupported format
- Test a file below the size limit
- Test a file at the exact limit
- Test a file above the limit
- Test an empty or minimum-size file
- Test a corrupted file
- Test a filename with spaces
- Test a filename with Unicode characters
- Test a very long filename
- Test a duplicate filename
- Test an interrupted upload
- Test a slow connection
- Test mobile browsers
- Confirm the server validates the file
- Confirm temporary uploads are deleted
A single successful upload does not prove that the entire workflow is reliable.
Create an Exact-Size Test File with ByteRivet
ByteRivet is designed to make exact-size file generation straightforward.
You can select a format, choose a measurement unit and enter the size required by your test. The generator also shows the exact byte value, helping you avoid confusion between decimal and binary units.
Use the ByteRivet Test File Generator to create a file for upload testing, API validation, storage checks or quality assurance workflows.
Frequently Asked Questions
How do I create a 10 MB test file?
Choose a format, select MB as the unit, enter 10 and generate the file. A decimal 10 MB file contains exactly 10,000,000 bytes.
Is 10 MB the same as 10 MiB?
No. A 10 MB file contains 10,000,000 bytes, while a 10 MiB file contains 10,485,760 bytes.
Can I create a PDF with an exact file size?
Yes, as long as the requested size is large enough to contain a valid PDF structure. Very small values may be below the format’s minimum size.
What is a dummy file?
A dummy file is a file created for testing rather than for storing important information. It may be used to test uploads, downloads, APIs, storage systems or validation rules.
Which format is best for upload testing?
Use the format accepted by the application. Choose BIN or TXT when only the exact size matters, and choose PDF, JPG, CSV, JSON or another valid format when file type validation is also being tested.
Can I test a maximum upload limit with one file?
A better method is to use three files: one just below the limit, one at the exact limit and one just above it.
Why does my operating system show a different file size?
The application may use binary units while labeling them as MB or GB. Check the exact byte count to confirm the real size.
Do test files contain real information?
They should not. Test files are intended to contain generated, placeholder or non-sensitive data.
More posts

File Upload Limits by Platform: The Complete 2026 Reference
Every major platform's file upload limit in one table — Gmail, Slack, Discord, WhatsApp, GitHub, and more — with a link to generate a test file at the exact size.

Test EXE Files: What They're For and How to Generate One Safely
A test .exe file with a real, valid header and zero executable code — useful for upload validation, security scanning, and installer-flow testing without any actual risk.

How to Test File Upload Limits: A Practical Guide
Testing an upload limit properly means three exact files, not one: at the limit, one byte over, and comfortably under — here's how and why.