How to generate a random string
Generate a cryptographically random string for tokens, keys, and IDs. Free tool plus the secure one-liner in each language.
A random string is the building block for tokens, secrets, salts, and unique IDs. The key is to use a cryptographically secure source, not a predictable one. Here is how to generate a good one.
Use a secure random source
Never build "random" strings from timestamps, counters, or Math.random() for anything security-sensitive — they are predictable. Use a cryptographically secure generator. Our token generator does this; in code use crypto.randomBytes (Node), secrets.token_urlsafe (Python), or crypto/rand (Go).
Length and alphabet
Pick a length that gives enough entropy — 32 characters from a large alphabet is a strong default for tokens and secrets. For values that go in URLs, use a URL-safe alphabet (letters, digits, - and _) so you do not need extra encoding.
Step by step
Open the token generator and choose your length (32+ for secrets).
Generate and copy the string.
In code, prefer crypto.randomBytes / secrets.token_urlsafe / crypto/rand — never Math.random for secrets.
Use a URL-safe alphabet if the value goes into a URL.
Try it now — free, no signup
Use the token generator in your browser. Then, when you need it at scale with an API key and higher limits, grab the full Eveses API.