How does a computer generate 'random' numbers?

How close to truly 'random' can a number generated by a computer actually be?

Is there software / programming language out that that might generate a more 'truly random' number than others?

closed as too broad by Xavierjazz, random Oct 7 '14 at 15:48

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Many common implementations of random number generators, are not truly random. Computers typically utilize Pseudorandom Number Generators, which means the computer uses a defined algorithm to generate a sequence of numbers that appear to be random.

In Python you can use the random module to generate pseudorandom numbers. However, if you look at the docs, they include this note:

Warning The pseudo-random generators of this module should not be used for security purposes. Use os.urandom() or SystemRandom if you require a cryptographically secure pseudo-random number generator.

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