These generators use `crypto.getRandomValues` and show the entropy or range involved. The password generator reports estimated bits, the number generator samples uniformly without modulo bias, and the color generator shows contrast ratios so a random swatch does not become unreadable text.
Random Generators
Randomness for security is different from randomness for test data. Passwords and tokens need a cryptographically secure source; a fixture that only needs to look random does not. `Math.random` is fine for a placeholder color and unsuitable for a session token because its internal state can be reconstructed from outputs.
What people use these for
- Create a 20-character password for an account that allows long credentials.
- Generate unique integers for a lottery-style draw or a sampling task.
- Produce placeholder hex colors for a chart prototype.
- Get a random string for a test fixture without pulling in a dependency.
Tools in this family
4 interactivePassword Generator
Generate strong passwords with upper/lowercase letters, digits and symbols. Set the length, exclude ambiguous characters, and copy securely.
Random String
Generate random strings for IDs, tokens, test data and slugs. Choose length, alphabet and case, using cryptographic randomness.
Random Number
Generate random integers or decimals within a range. Set min, max and count, with an option for unique values.
Random Hex Color
Generate random hex colors, copy them as #RRGGBB, and see a preview swatch. Useful for design placeholders, charts and test data.
Entropy is length times alphabet
A password's strength is roughly `length × log2(alphabet size)`. Sixteen characters from a 62-character alphabet give about 95 bits; adding symbols raises the per-character cost slightly but extending the length raises it linearly. For most accounts, length is the more practical lever, provided the system accepts it.
Random output still needs handling
A strong password pasted into a weak system is still exposed. Store secrets in a password manager, hash tokens on the server, compare them in constant time, and never log them. Randomness solves predictability, not storage or transport.
Frequently asked questions
Is Math.random safe for passwords?
No. It is not a cryptographic generator and its outputs can leak internal state. Use `crypto.getRandomValues` or a dedicated password manager.
Are random colors useful for design?
For placeholders and test data, yes. For a real palette, constrain hue, saturation and lightness; uniform sampling produces many muddy mid-tones.
Can I generate unique numbers larger than the range?
No. Uniqueness requires at least as many distinct values as the count; the generator limits the count to the range size.