Random number generators are important in many kinds of technical applications, including physics, engineering or mathematical computer studies (e.g., Monte Carlo simulations), cryptography and gambling (on game servers).

This list includes many common types, regardless of quality or applicability to a given use case.

Pseudorandom number generators (PRNGs)

The following algorithms are pseudorandom number generators.

GeneratorDateFirst proponentsReferencesNotesMiddle-square method1946J. von NeumannSome of von Neumann's 1949 papers were printed only in 1951. John von Neumann, “Various techniques used in connection with random digits,” in A.S. Householder, G.E. Forsythe, and H.H. Germond, eds., Monte Carlo Method, National Bureau of Standards Applied Mathematics Series, vol. 12 (Washington, D.C.: U.S. Government Printing Office, 1951): pp. 36–38.In its original form, it is of poor quality and of historical interest only. Lehmer generator1951D. H. LehmerOne of the earliest and most influential designs.Linear congruential generator (LCG)1958W. E. Thomson; A. Rotenberg A generalisation of the Lehmer generator. Historically, the most influential and studied generator.Lagged Fibonacci generator (LFG)1958G. J. Mitchell and D. P. MooreD. E. Knuth, The Art of Computer Programming, Vol. 2 Seminumerical Algorithms, 3rd ed., Addison Wesley Longman (1998); See pag. 27.Linear-feedback shift register (LFSR)1965R. C. TauswortheA hugely influential design. Also called Tausworthe generators.Wichmann–Hill generator1982B. A. Wichmann and D. I. HillA combination of three small LCGs, suited to 16-bit CPUs. Widely used in many programs, e.g. it is used in at least Excel 2003 and 2007 for the Excel function RAND and it was the default generator in the language Python up to version 2.2.Rule 301983S. WolframBased on cellular automata.Inversive congruential generator (ICG)1986J. Eichenauer and J. LehnBlum Blum Shub1986M. Blum, L. Blum and M. ShubBlum-Blum-Shub is a PRNG algorithm that is considered cryptographically secure. It is based on prime numbers.Park-Miller generator1988S. K. Park and K. W. MillerA specific implementation of a Lehmer generator, widely used because it is included in C++ as the function minstd_rand0 from C++11 onwards.ACORN generator1989 (discovered 1984) R. S. WikramaratnaWikramaratna, R.S. Theoretical and empirical convergence results for additive congruential random number generators, Journal of Computational and Applied Mathematics (2009), The Additive Congruential Random Number generator. Simple to implement, fast, but not widely known. With appropriate initialisations, passes all current empirical test suites, and is formally proven to converge. Easy to extend for arbitrary period length and improved statistical performance over higher dimensions and with higher precision. MIXMAX generator1991G. K. Savvidy and N. G. Ter-Arutyunyan-SavvidyIt is a member of the class of matrix linear congruential generators, a generalisation of LCGs. The conceptual framework behind the MIXMAX family of generators relies on results from ergodic theory and classical mechanics.Add-with-carry (AWC)1991G. Marsaglia and A. ZamanA modification of Lagged-Fibonacci generators.Subtract-with-borrow (SWB)1991G. Marsaglia and A. Zaman A modification of Lagged-Fibonacci generators. A SWB generator is the basis for the RANLUX generator, widely used e.g. for particle physics simulations.Maximally periodic reciprocals1992R. A. J. MatthewsA method with roots in number theory. Never used in practical applications.KISS1993G. MarsagliaPrototypical example of a combination generator.Multiply-with-carry (MWC)1994G. Marsaglia; C. KoçPost by George Marsaglia on the newsgroup sci.stat.math dated 1 August 2018 with title 'Yet another RNG'.Complementary-multiply-with-carry (CMWC)1997R. Couture and P. L’EcuyerMersenne Twister (MT)1998M. Matsumoto and T. NishimuraClosely related with LFSRs. Its MT19937 implementation is probably the most commonly used modern PRNG. Default generator in R and the Python language starting from version 2.3.Xorshift2003G. MarsagliaA sub-type of LFSR generators designed to be efficiently implemented in software. Marsaglia also suggested as an improvement the xorwow generator, in which the output of a xorshift generator is added with a Weyl sequence. The xorwow generator is the default generator in the CURAND library of the nVidia CUDA application programming interface for graphics processing units.Well equidistributed long-period linear (WELL)2006F. Panneton, P. L'Ecuyer and M. MatsumotoA LFSR closely related with Mersenne Twister, aiming at remedying some of its shortcomings.A small noncryptographic PRNG (JSF) 2007Bob JenkinsSmall Fast Chaotic PRNG (SFC) 2010Chris Doty-HumphreyAdvanced Randomization System (ARS)2011J. Salmon, M. Moraes, R. Dror and D. ShawA simplified version of the AES block cipher, leading to very fast performance on systems supporting the AES-NI.Threefry2011J. Salmon, M. Moraes, R. Dror and D. ShawA simplified version of the Threefish block cipher, suitable for GPU implementations.Philox2011J. Salmon, M. Moraes, R. Dror and D. ShawA simplification and modification of the block cipher Threefish with the addition of an S-box.WELLDOC 2013L. Balkova, M. Bucci, A. de Luca, J. Hladky, S. PuzyninaA set of periodic pseudorandom number generators based on infinite words.SplitMix2014G. L. Steele, D. Lea and C. H. FloodBased upon the final mixing function of MurmurHash3. Included in Java Development Kit 8 and above.Permuted Congruential Generator (PCG)2014M. E. O'NeillA modification of LCG.Random Cycle Bit Generator (RCB)2016R. CookmanRCB is described as a bit pattern generator made to overcome some of the shortcomings of the Mersenne Twister and the short periods of shift/modulo generators.Middle-Square Weyl Sequence RNG (see also middle-square method)2017B. WidynskiA variation on John von Neumann's original middle-square method. One of the fastest generators that passes all the tests in BigCrush and PractRand.xorshiftr+2018U. C. Çabuk, Ö. Aydın, and G. DalkılıçA modification of xorshift+. Significantly faster than its predecessor and passes all tests in the BigCrush suite.Xoroshiro128+2018D. Blackman, S. VignaA modification of Marsaglia's Xorshift generators. One of the fastest generators on modern 64-bit CPUs. Related generators include xoroshiro128**, xoshiro256+ and xoshiro256**.LXM 2021G. L. Steele, S. VignaComposite generators combining two pseudorandom sub-generators (a linear congruential and an xor-based generator) and a mixing function (the MurmurHash3 function). Several of these generator are implemented as part of Java 17.64-bit MELG (MELG-64)2018S. Harase, T. KimotoAn implementation of 64-bit maximally equidistributed F2-linear generators with a Mersenne prime period.Squares RNG2020B. WidynskiA counter-based version of Middle-Square Weyl Sequence RNG. Similar to Philox in design but significantly faster.Collatz-Weyl Generators2023Tomasz R. DziałaA class of chaotic counter-based generators applying a broad class of non-invertible generalized Collatz mappings and Weyl sequences, enabling the generation of multiple independent streams. Leveraging 128-bit arithmetic allows for a highly efficient implementation, especially on modern 64-bit architectures.

Cryptographic algorithms Cipher algorithms and cryptographic hashes can be used as very high-quality pseudorandom number generators. However, generally they are considerably slower (typically by a factor 2–10) than fast, non-cryptographic random number generators.

These include:

Stream ciphers. Popular choices are Salsa20 or ChaCha (often with the number of rounds reduced to 8 for speed), ISAAC, HC-128 and RC4. Block ciphers in counter mode. Common choices are AES (which is very fast on systems supporting it in hardware), TwoFish, Serpent and Camellia. Cryptographic hash functions

A few cryptographically secure pseudorandom number generators do not rely on cipher algorithms but try to link mathematically the difficulty of distinguishing their output from a `true' random stream to a computationally difficult problem. These approaches are theoretically important but are too slow to be practical in most applications. They include: Blum–Micali algorithm (1984) Blum Blum Shub (1986) Naor–Reingold pseudorandom function (1997)

Random number generators that use external entropy These approaches combine a pseudo-random number generator (often in the form of a block or stream cipher) with an external source of randomness (e.g., mouse movements, delay between keyboard presses etc.).

/dev/random – Unix-like systems CryptGenRandom – Microsoft Windows Fortuna RDRAND instructions (called Intel Secure Key by Intel), available in Intel x86 CPUs since 2012. They use the AES generator built into the CPU, reseeding it periodically. Yarrow RANDOM.org

See also Diceware Diehard tests – statistical test suite for random number generators Non-uniform random variate generation Hardware random number generator Random number generator attack Randomness TestU01 – statistical test suite for random number generators

References

External links SP800-90 series on Random Number Generation, NIST Random Number Generation in the GNU Scientific Library Reference Manual Random Number Generation Routines in the NAG Numerical Library Chris Lomont's overview of PRNGs, including a good implementation of the WELL512 algorithm Source code to read data from a TrueRNG V2 hardware TRNG