File Exchange

image thumbnail

RANDI_ORG: True random integer numbers

version (3.51 KB) by Giampiero Salvi
Queries to collect true random integer numbers.


Updated 18 Jun 2010

View License

The RANDI_ORG function has a similar usage as the RANDI function. However, instead of returning pseudo-random numbers, it queries the site to collect true random numbers. Refer to the web site for a discussion on the difference between pseudo and true randomness.

Note that allows limited traffic per day, check the site for more details.

Cite As

Giampiero Salvi (2020). RANDI_ORG: True random integer numbers (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Thanks for the feedback! Now the function uses urlread and there's a warning about limited traffic from

Oleg Komarov


An example:

I think this method will be feasible through platforms.



Did you try URLREAD to get the values?
It is necessary to mention the guidelines of the web service, which involve a quota of 2e5 bits per day, which accumulates to upto 1e6 bits, per TCP/IP. If the quota is exceeded, stop requesting new values. Get values in as large chunks as possible, because requesting single numbers produces large traffic on the server.
Thanks, Jan

Simon Cross

This looks like a very useful functions for a lot of my projects which rely on'random' numbers and I would prefer them to be really random, so many thanks for posting it. Unfortunately when I run it I get the following error message:

??? Undefined function or variable 'a'

Error in ==> randi_org at 61
if any(a<+0)

I am running it in Mac OSX Leopard

Thanks for your help

Simon Cross


- fixed limitation of 10000 numbers per query

- without arguments checks for quota at

- removed dependencies on curl (using urlread instead)
- added warning about limited traffic from

- fixed small bug

- fixed examples in the help text
- fixed handling of negative sizes

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux