The dqrng package provides fast random number generators (RNG) with good statistical properties for usage with R. It combines these RNGs with fast distribution functions to sample from uniform, normal or exponential distributions. Both the RNGs and the distribution functions are distributed as C++ header-only library.


The currently released version is available from CRAN via

Intermediate releases can also be obtained via drat:


Using the provided RNGs from R is deliberately similar to using R’s build-in RNGs:

They are quite a bit faster, though:

This is also true for the provided sampling functions with replacement:

And without replacement:

Note that sampling from 10^10 elements triggers “long-vector support” in R.

In addition the RNGs provide support for multiple independent streams for parallel usage:


All feedback (bug reports, security issues, feature requests, …) should be provided as issues.