Creating large test files is often necessary for tasks such as testing file transfer speeds, testing storage limits, or assessing the performance of applications that handle large files. This article will guide you through various methods to quickly generate large test files in Windows 11 or Windows 10, including using built-in tools like FSUTIL and the Command Prompt, PowerShell, and third-party tools. We will also cover creating large files for specific applications, such as Word documents or Excel spreadsheets.
Also see: How to Find Huge Files in Windows 11
Page Contents
Using FSUTIL to create large test files
FSUTIL is a command-line utility designed for managing file systems and volumes in Windows. It is a versatile tool that can create empty files, large text files of specific sizes, or even files of specific formats like Word documents or Excel spreadsheets. In addition to creating large test files, FSUTIL can be used for other tasks such as querying free space on a volume or managing reparse points.
To create a large test file using FSUTIL, follow these steps:
- Press Win + R to open the Run dialog box. Type
cmd
and press Enter to open the Command Prompt. - To create a test file of a specific size, use the following command syntax:
fsutil file createnew <filename> <filesize_in_bytes>
For example, to create a 1GB test file named “testfile1gb.docx“, enter the following command:
fsutil file createnew testfile1gb.docx 1073741824
The file will be created in the current working directory of the Command Prompt. You can specify a different directory by providing the full path to the file. Keep in mind that creating large files may take some time, depending on the file size and the performance of your computer.
Note: You can create a file with any extension. The example above is to create a Word document file (.docx). If you want to create a file of another format such as Excel spreadsheets, simply change the extension to “.xlsx“. You can also remove the extension to create a plain file without any extension.
However, the files created this way may not be usable in their respective supported applications, as they are filled with null data and do not contain the proper structure required for these applications. To create large files with usable content for a specific application such as MS Word or Excel, refer to the subsequent sections for methods tailored to creating large text files and large files for specific applications.
Related problem: File Transfer Speed Very Slow or Drops to Zero in Windows 11
Creating various file sizes
With FSUTIL, you can create test files of any size by changing the filesize_in_bytes value. Here are some examples of creating different file sizes:
- Create a 100MB test file:
fsutil file createnew testfile100mb.dat 104857600
- Create a 5TB test file:
fsutil file createnew testfile5tb.dat 5497558138880
- Create a 1TB test file:
fsutil file createnew testfile1tb.dat 1099511627776
You can also create test files with specific sizes like 55GB, 101MB, or 90MB by adjusting the filesize_in_bytes
parameter accordingly. Just keep in mind that creating very large files might require a significant amount of free space on your hard drive.
When creating test files of various sizes, it’s essential to know the corresponding number of bytes for each file size. Here’s a quick reference for some common file sizes:
- 1 MB = 1,048,576 bytes
- 100 MB = 104,857,600 bytes
- 1 GB = 1,073,741,824 bytes
- 10 GB = 10,737,418,240 bytes
- 100 GB = 107,374,182,400 bytes
- 1 TB = 1,099,511,627,776 bytes
- 10 TB = 10,995,116,277,760 bytes
Use this reference to quickly convert file sizes to bytes when creating test files using FSUTIL or PowerShell.
Useful tip: How to Batch Rename Files in Windows 11
Creating large text files
Creating large text files can be useful for testing applications that process or manipulate textual data. Here’s an example of how to create a large text file using FSUTIL and the Command Prompt:
- First, create a small text file with some content. For example, create a file named sample.txt containing the following text:
This is a sample text file for testing purposes.
- Next, create an empty text file and name it large_text_file.txt.
- Now, use a loop to copy the contents of the sample text file into the large empty file:
for /L %i in (1, 1, <number_of_iterations>) do type sample.txt >> large_text_file.txt
- Replace
<number_of_iterations>
with the number of times you want to copy the content from the sample text file. This value will depend on the size of the sample file and the desired size of the large text file.
For example, if the sample file is 50 bytes and you want to create a 1GB (1,073,741,824 bytes) text file, you would need to copy the contents of the sample file approximately 21,474,836 times:
for /L %i in (1, 1, 21474836) do type sample.txt >> large_text_file.txt
Keep in mind that creating very large text files using this method might take some time, depending on the size of the file and the performance of your computer.
Linked issue: Batch (.BAT) Files Not Running in Windows 11/10
Creating large files for specific applications
Creating large test files for specific applications like Word documents, Excel spreadsheets, or MP4 video files can be done with the help of third-party tools or by manually generating data. Here are some examples:
- Large Word Documents: To create a large Word document for testing purposes, you can copy and paste dummy text repeatedly until you reach the desired file size. Alternatively, you can use a text generator like Lorem Ipsum to generate the content and then save it as a Word document.
- Large Excel Files: To create a large Excel file for testing, you can fill the cells with random data or use Excel’s built-in functions to generate data. For example, you can use the
RAND()
function to generate random numbers in a range of cells, or use theREPT()
function to repeat text strings. - Large MP4 Video Files: To create a large MP4 test file, you can use video editing software to generate or duplicate content until you reach the desired file size. Alternatively, you can download existing large video files from websites that provide free stock footage.
Recommended resource: How to Convert CSV or TXT to Excel in Windows 11
Creating large test files with PowerShell
Windows PowerShell is another powerful command-line tool in Windows that can be used to create large test files. Using PowerShell, you can create files of various sizes and formats.
Here’s an example of how to create a large test file using PowerShell:
- Press Win + X and click on “Windows PowerShell” or “Windows PowerShell (Admin)” to open PowerShell.
- To create a test file of a specific size, use the following command syntax:
$f = [System.IO.File]::Create("<filename>") $f.SetLength(<filesize_in_bytes>) $f.Close()
Replace
<filename>
with the name of the file you want to create, and<filesize_in_bytes>
with the desired size of the file in bytes.
For example, to create a 1GB test file named testfile1gb.dat
, enter the following commands:
$f = [System.IO.File]::Create("testfile1gb.dat") $f.SetLength(1073741824) $f.Close()
The file will be created in the current working directory of the PowerShell session. You can specify a different directory by providing the full path to the file. Keep in mind that creating large files may take some time, depending on the file size and the performance of your computer.
Suggested guide: How to Compare Two Folders in Windows 11
You can also use PowerShell to create large text files by repeatedly writing text to a file until it reaches the desired size. Here’s an example of how to create a large text file using PowerShell:
- First, create a small text file with some content. For example, create a file named
sample.txt
containing the following text:
This is a sample text file for testing purposes. - Next, open PowerShell and use the following commands to create a large text file:
$sampleText = Get-Content "<path_to_sample.txt>" $largeTextFile = "<path_to_large_text_file.txt>" $desiredFileSize = <desired_filesize_in_bytes> while ((Get-Item -Path $largeTextFile).Length -lt $desiredFileSize) { Add-Content -Path $largeTextFile -Value $sampleText }
Replace
<path_to_sample.txt>
with the path to the sample text file,<path_to_large_text_file.txt>
with the path to the large text file you want to create, and<desired_filesize_in_bytes>
with the desired size of the text file in bytes.
For example, if the sample file is 50 bytes and you want to create a 1GB (1,073,741,824 bytes) text file, you would use the following commands:
$sampleText = Get-Content "C:\sample.txt" $largeTextFile = "C:\large_text_file.txt" $desiredFileSize = 1073741824 while ((Get-Item -Path $largeTextFile).Length -lt $desiredFileSize) { Add-Content -Path $largeTextFile -Value $sampleText }
PowerShell provides a versatile alternative to using FSUTIL and the Command Prompt for creating large test files in Windows 11 or 10.
Final thoughts
Understanding how to create test files of different sizes and formats is essential for evaluating the performance and reliability of applications, file transfer mechanisms, and storage systems. By using these methods, you can quickly identify potential bottlenecks and limitations in your systems, helping you optimize and improve their overall efficiency.
Additionally, it’s important to consider the available storage space on your computer and the time it takes to create large files when using these methods. Always ensure that your system has sufficient resources to handle the generation of large test files to avoid potential issues. Moreover, when working with very large files, consider using faster storage mediums like solid-state drives (SSDs) to speed up the file generation and transfer process.