Random generators for security, testing and fun
Randomness is needed in surprisingly many places: unique IDs for database rows, passwords and API tokens, sample data for tests, placeholder text for designs and fair draws for giveaways. These random generators cover all of them. Security-relevant values (UUIDs, passwords, strings, bytes and numbers) come from the browser's cryptographically secure random source, and nothing is sent to a server.
Pick a generator
- Identifiers – the UUID generator creates version 4 or time-ordered version 7 UUIDs in bulk.
- Secrets – the password generator for strong random passwords, the memorable password generator for passphrases, and the random string generator and random byte generator for tokens and keys.
- Numbers – the random number generator plus integer, decimal, fraction, prime, binary and hex variants.
- Test data – the random JSON generator, random CSV, TSV and XML generators produce realistic fake names, emails, addresses and dates; data from regex creates values matching any pattern.
- Dates and network values – random dates, times, IP and MAC addresses.
- Content – the lorem ipsum generator for placeholder text and the random word generator for prompts.
- Everyday decisions – the random name picker for fair draws, plus random colors, emoji and usernames.
Secure randomness vs realistic randomness
Two kinds of randomness serve different goals. Cryptographically secure randomness (crypto.getRandomValues) is unpredictable, which is essential for passwords, tokens and keys. Realistic fake data, such as names and addresses, only needs to look plausible, so it comes from a fake-data library. Never use fake-data output, like generated "passwords" in a test record, as a real secret.
Typical workflows
- Seeding a database – generate a few thousand records as CSV or JSON, add UUIDs as keys, and import them into a development database.
- Testing validation – create inputs that match or deliberately break a pattern using the regex generator.
- Designing layouts – fill mockups with lorem ipsum and generated names to see how real content lengths behave.
- Running a raffle – paste the entrant list into the name picker and draw winners without repeats.
Fairness and repeatability
Every generator draws fresh values on each run, and results are not stored anywhere. That makes draws fair, since nobody can predict the outcome, but it also means you should copy or download results you need to keep, such as the winners of a giveaway or a set of test fixtures you want to reuse.
Tips
- Use at least 128 bits of randomness for tokens (for example 32 hex characters or 22 URL-safe characters).
- Store generated passwords in a password manager, not in plain text.
- Generated emails may use real provider domains; do not send messages to them.