Random Data Generator
Generate random values of any type, with the distinction between random and cryptographically secure made explicit.
Last reviewed by the Radiatus Cloud team
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
Two kinds of random, used for different things
A pseudorandom generator produces a deterministic sequence from a seed. It is fast, statistically well-distributed, and entirely predictable to anyone who learns the state — which a handful of outputs is often enough to recover. A cryptographically secure generator draws on operating system entropy and is designed so past output reveals nothing about future output. Simulations, sampling, shuffling a playlist and test data want the first. Tokens, keys, passwords and anything an attacker benefits from predicting require the second, and the failure is silent when the wrong one is used.
Range bias is easy to introduce
Taking a random number modulo a range skews the result unless the range divides the generator's period evenly. With small ranges the bias is negligible; with large ones it is measurable, and in a security context it narrows the search space. Rejection sampling — discarding values in the unusable tail and drawing again — removes it, and most standard libraries now expose a correct range function that does this internally.
Shuffling has one correct algorithm
Fisher-Yates produces a uniform permutation in linear time. Sorting with a random comparator, the common shortcut, does not: it produces a biased distribution and, in some engines, undefined behaviour because the comparator is inconsistent. This appears constantly in code that shuffles quiz questions or randomises a list, and the bias is invisible without testing for it.
Seeds make randomness reproducible
A fixed seed produces the same sequence every run, which is exactly what testing, simulation and debugging need — a failure that cannot be reproduced cannot be investigated. Never seed a security-relevant generator, and never seed with the current time, since the value is guessable within a narrow window and this has broken real systems.
Human intuition about randomness is poor
People reject genuine random sequences for containing runs and clusters, which random data reliably produces. In 20 coin flips a run of four is likely. Streaming services deliberately de-randomise shuffle because true random feels broken to listeners. If output looks suspiciously clumpy, that is usually evidence it is working.
Uniform is not the only distribution
Uniform random suits dice and selection. Real-world quantities rarely are: response times are long-tailed, natural measurements are roughly normal, and file sizes and city populations follow power laws. Test data drawn uniformly misses precisely the extremes that cause production failures.
Related tools
- User Agent Parser — Parse a User-Agent string into browser, engine, operating system and device. Explains why UA strings are unreliable and what to use instead.
- QR Code Generator — Generate QR codes for URLs, text, Wi-Fi and contact details. Adjustable error correction and size, produced entirely in your browser.
- Credit Card Validator — Validate a card number with the Luhn algorithm and identify the issuing network from its prefix. Runs locally, nothing is transmitted.
- Text Case Converter — Convert text between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case and sentence case. Runs entirely in your browser.
Frequently Asked Questions
What is the difference between random and cryptographically secure random?
A pseudorandom generator is fast and predictable once its state is known; a cryptographically secure one draws on OS entropy so past output reveals nothing about future output. Tokens and keys require the second.
Why is modulo biased?
Because the range rarely divides the generator's period evenly, so some values occur slightly more often. Rejection sampling removes it, and most standard libraries now handle this internally.
What is wrong with sorting by a random comparator?
It does not produce a uniform permutation and gives an inconsistent comparator, which is undefined behaviour in some engines. Fisher-Yates is the correct algorithm and runs in linear time.
Should I seed a random generator?
For testing, simulation and debugging, yes — reproducibility is the point. Never for security, and never with the current time, which is guessable within a narrow window.
Why does my random output look clumpy?
Because genuine randomness produces runs and clusters. In 20 coin flips a run of four is likely. Output that looks too even is more suspicious than output that looks clumpy.
Privacy & Security
Generated locally.
About This Tool
This tool runs entirely in your browser. No data is sent to any server, ensuring complete privacy. Simply use the interface above to get started — no registration or login required.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
User Agent Parser
UtilityParse a User-Agent string into browser, engine, operating system and device. Explains why UA strings are unreliable and what to use instead.
QR Code Generator
UtilityGenerate QR codes for URLs, text, Wi-Fi and contact details. Adjustable error correction and size, produced entirely in your browser.
Credit Card Validator
UtilityValidate a card number with the Luhn algorithm and identify the issuing network from its prefix. Runs locally, nothing is transmitted.