Random String Generator — Free Token Generator & API Key Generator
Free random string and token generator: create secure API keys, secret keys and random tokens with custom length, character sets, hex/Base64URL presets, pref...
To generate a random string, pick the character sets and length; a secure token appears instantly. Click Refresh for a new one, then copy it or download it as a .txt file.
Last updated:
Random String Generator — Free Token Generator & API Key Generator. Free random string and token generator: create secure API keys, secret keys and random tokens with custom length, character sets, hex/Base64URL presets, prefixes and bulk generation.
Our random string generator creates cryptographically secure random strings right in your browser. Choose the length (1–512 characters), mix uppercase letters, lowercase letters, numbers and symbols, and get a fresh value with one click.
It doubles as a token generator for session IDs, password-reset links and invitation codes, an API key generator with optional prefixes such as sk_live_ or pk_, and a secret key generator for signing cookies, webhooks or JWTs.
Every character is picked with the Web Crypto CSPRNG (crypto.getRandomValues) using unbiased rejection sampling — no Math.random(), no predictable patterns. Need a specific format?
One-click presets produce a random hex generator output (0-9a-f), URL-safe Base64URL tokens, Base32 secrets for authenticator apps and numeric PIN codes, or type your own custom alphabet.
Turn on "exclude look-alike characters" to drop i, l, 1, L, o, 0, O and I for codes people have to read or type, and generate up to 100 tokens at once for bulk seeding, coupon codes or test fixtures — a fast way to generate random strings and random alphanumeric identifiers.
The live entropy meter shows how many bits of randomness each token carries and rates it from very weak to very strong.
For human-memorable secrets use the Passphrase Generator, for unique IDs use the UUID Generator or ULID Generator, and to check an existing password try the Password Strength Checker.
Nothing is ever sent over the network: tokens are generated and stay on your device, so it is safe to create production random keys here. Copy the result, download it as a .txt file, or share a link that restores your settings (never the token itself).
Related tools: JWT Generator to sign a token with your new secret, HMAC Generator, Hash Text, Bcrypt and the OTP Generator for TOTP secrets.
Frequently asked questions
How do I generate a random string or API key?
Switch Uppercase, Lowercase, Numbers or Symbols on or off and set Token length with the slider or number box (1 to 512, default 64). A token appears immediately; click Refresh for a new value, Copy token to copy it or Download .txt to save it. Add a Prefix such as sk_live_ for API-key style tokens.
Are the generated tokens secure?
Yes. Each character is chosen with the browser's Web Crypto random generator (crypto.getRandomValues) using unbiased rejection sampling, not Math.random. Tokens are created on your device and never sent anywhere; share links contain your settings but not the token.
What do the Hex, Base64URL, Base32 and Numeric PIN presets do?
They fill the Custom alphabet field: Hex uses 0-9 and a-f, Base64URL uses letters, digits, hyphen and underscore, Base32 uses A-Z and 2-7, and Numeric PIN uses digits only. A custom alphabet overrides the character switches; click Clear alphabet to go back to them.
What do the entropy and strength rating mean?
Entropy is length x log2 of the number of possible characters, in bits. The rating is Very weak below 28 bits, Weak below 36, Reasonable below 60, Strong below 128 and Very strong from 128 bits. A 64-character token of letters and digits has about 381 bits.
How do I generate many tokens at once?
Set Number of tokens to any value from 1 to 100. Each token appears on its own line, and Download .txt saves them all as tokens.txt, or token.txt when there is only one.
What does Exclude look-alikes do?
It removes characters that are easy to confuse when read or typed by a person: i, l, 1, L, o, 0, O, I and the vertical bar symbol. This lowers entropy slightly, which the meter shows, but makes codes easier to read out or copy by hand.
How to use this online tool
Random String Generator — Free Token Generator & API Key Generator is designed for fast browser workflows when you need to format, validate, convert, decode, encode, generate, or inspect data without opening a heavy desktop app. Start with the input field or visible options, review the result, then copy or download the output for the next step.
Private processing in your browser
Random String Generator — Free Token Generator & API Key Generator keeps the normal processing step local in your browser. That is useful for code snippets, tokens, documents, configuration values, text samples, and other material that should not be sent to a remote service unless you explicitly choose to share it.
When this tool is useful
Use Random String Generator — Free Token Generator & API Key Generator for repeatable developer tasks, technical documentation, QA checks, quick conversions, debugging, content cleanup, and internal team workflows. The page focuses on clear inputs, immediate feedback, and output that is easy to reuse in code, reports, tickets, emails, or notes.
Practical tips
Before copying the final result, check important details such as spacing, casing, filenames, encoding, token structure, line breaks, or output format. Small checks prevent mistakes when the result is reused in source code, API requests, documentation, spreadsheets, or shared files.