I am looking for an application that will create a file of an arbitrary size, filled with pseudo-random data.

Must be able to create files at least 1GB in size (larger is better).

The application must work within , but can have a or be a command line tool .

The data not be truly random, just pseudo-random.

The software must be .

I prefer and software, but neither is a requirement.

Note: Windows 7 SP1 is the lowest version of Windows that needs to be supported.

  • You could then use integrated wsh to script this but rdfc is probably easier (unless you have Python installed) – Marged Dec 25 '15 at 11:58
  • Note that speed is an important aspect to take into consideration for this kind of tool. I haven't tested the solution with Python, but I quickly put together a basic PowerShell script and performances were terrible even for a 1 MB file. RDFC and dd are very fast. – mguassa Feb 2 '16 at 21:48
  • 1
    mguassa, PowerShell is fast if you use something like suggested here: stackoverflow.com/questions/49835860/… – tolache Jan 31 '19 at 13:55

You can use Random Data file Creator (RDFC).

Random Data File Creator, briefly RDFC, is a console application for Microsoft Windows, which can be used to create binary files of any size filled with random numbers. So, for example developers can create very large files (i.e. 1 TB) in order to test, how their own application deals with it.

Here's a test I've just run on Windows 10 in order to create a 100 MB file:

rdfc file.bin 100 MB

RDFC test

The application is freeware and portable (it doesn't require installation).

  • 1
    Does the job at 10 MB/s, basically unusable. – Vlastimil Ovčáčík Feb 17 '18 at 13:28
  • I can confirm what Vlastimil Ovčáčík says: RDFC is slow. In my case 3.70MB/sec when creating a 100 MB file. Tested with Microsoft Windows 10. – Franck Dernoncourt May 20 '18 at 0:36

You can use Dummy File Creator:

  • Free for educational and non-commerical personal use
  • Portable
  • Microsoft Windows (requires Microsoft .NET Framework 3.5)
  • GUI and CLI

enter image description here

enter image description here

  • option to generate file with random content. True random in v1.1 but not in v1.2:

Dummy File Creator 1.2 writes random bytes ranging from 0 to 255. However, unlike previous version which generates true random file content, Dummy File Creator 1.2 uses a different approach in random content generation in order to increase the performance of random content generation. Dummy File Creator now will generate 4MB of random data and reuse the same data by altering only some bytes at random locations for each subsequent write. While the result still defeats all of the compression software we tested (i.e. a larger compressed file than the original size), but it is still possible to compress this pseudo-random content if a specifically designed compression algorithm targeted at Dummy File Creator (very unlikely) is used. To design such algorithm, it must use dictionary words with length ranging from 1 to 4,194,303 bytes. Most people will not notice this change, but for people who are developing compressing algorithms, it is recommended to use the previous version which generates true random contents (but much slower) for testing.

  • Wow. That looks simple to use. Thanks Franck. – RockPaperLizard Feb 4 '16 at 7:50
  • The best tool i have ever seen , like it's tremendously fast ! – GOXR3PLUS Apr 12 '19 at 8:55

dd for Windows is portable and open source.

It's the Windows version of the popular dd utility for Unix.

Here's an example about the creation of a 100 MB file:

dd bs=100M count=1 if=/dev/random of=C:\tmp\file.dat --progress

dd demo

I've used version 0.5 on Windows 10.


Python is free, gratis & open source, and cross platform and can be used as a script or interactivly - depending on the sort of random contents you need is would be as simple as:

from random import randint

desired_size = 1024*1024*1024 # 1 GByte
with open('RandomData.dat', 'wb') as outfile: # Open for binary output
    for x in xrange(desired_size):
       outfile.write(chr(randint(0,255))) # Write a random byte
print 'Done.'

You could of course expand the above to prompt for, or receive on the command line, the file name & desired size, to restrict the range or to output random text, etc.

  • I don't want to remember 6 lines of code for this. – Vlastimil Ovčáčík Feb 17 '18 at 13:29
  • @VlastimilOvčáčík: You could always skip the done and put the desired size directly into the xrange which would cut it down to 4 lines if you memory is a problem - :-) – Steve Barnes Feb 18 '18 at 6:10

In Python 3, to generate 25 files of 10GB each:

import os
desired_size = 1024*1024*1024*10 # 10 GBytes
desired_number_of_files = 25
for file_number in range(desired_number_of_files):
    filename = 'output_file{0:04d}.dat'.format(file_number)
    print('filename: {0}'.format(filename))
    with open(filename, 'wb') as fout: fout.write(os.urandom(desired_size))

The line that generates the data (i.e. the line with urandom) is from Jon Clements on Creating random binary files. Also, in case you wonder: Whats the difference between os.urandom() and random?.

The speed on my computer (Microsoft Windows 10) is around 250 MB/second.

  • 1
    WARNING: To generate 10GB file this snippet will take 10GB of RAM since it buffers random string to memory first. – Zaar Hai yesterday
  • @ZaarHai Thanks for the feedback, good point, I don't remember regarding the memory behavior. If that's an issue, maybe one could add some of the flushing ideas mentioned in How often does python flush to a file?. – Franck Dernoncourt yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.