Generate File of Specific Size in Windows (Very Simple)
Sometimes you just need a large file to test some web forms, APIs, or disk performances.
Usually, you would go to a site to download that file.
But in this post, I’m going to show you how to quickly and easily generate a binary file of any size on a Windows machine.
So you don’t have to waste your time.
Let’s get started!
Open the Command Prompt as Administrator.
Run the following command:
fsutil file createnew <file> <size in bytes>
For example, this command will create a 1GB file called
dummyFileon my Desktop.
fsutil file createnew C:\Users\Carol\Desktop\dummyFile 1073741824
Here is a table with some common file sizes:
|MB||Bytes (in binary)|
Just out of curiosity, if we open the file and inspect its content using Visual Studio Code Hex Editor extension we can see the file is indeed binary and it’s full of
In human language, that means it’s full of
That’s it! 🎉
Happy coding 😊
Let me know what you think about this article in the comments section below.
If you find this article helpful, please share it with others and subscribe to the blog to support me, and receive a bi-monthly-ish e-mail notification on my latest articles.