Issue an API key for your service
Generate a 32-byte Base64URL key with a prefix such as myapp_live_, show it to the customer once and keep only its SHA-256 hash on the server.
Create up to 20 random tokens at once for API keys, webhook secrets or session tokens, in hex, Base64 or Base64URL, with a prefix such as sk_live_ and the entropy shown. Generated locally.
This generator produces cryptographically secure random tokens from 8 to 256 bytes, up to 20 at a time, in hex, Base64 or Base64URL. It is for developers and administrators who need an API key, a webhook secret, a reset token or a signing key without opening a terminal.
The bytes come from crypto.getRandomValues, the browser's cryptographic random generator seeded by the operating system, not from Math.random, which is predictable. The entropy shown is simply the number of bytes times 8: the default 32 bytes give 256 bits, or 2^256 possible values, far beyond what any brute-force attack can cover. For an authentication token, 128 bits (16 bytes) is a reasonable floor and 256 bits a comfortable choice for an API key or an HMAC secret.
Encoding does not change security, only the length and the characters used. The same 32 bytes give 64 characters in hex, 44 in Base64 with the trailing "=", and 43 in Base64URL (RFC 4648, section 5), which replaces "+" and "/" with "-" and "_" and drops padding so the token can appear as-is in a URL, an HTTP header or a file name. The optional prefix, such as sk_live_, is added in front of the token without counting toward entropy: it identifies the key type at a glance and helps secret scanners, such as GitHub's, spot a leak.
Choose the number of bytes (8 to 256, 32 by default) and the output format: hex, Base64 or Base64URL. The matching entropy in bits is displayed.
Enter a prefix such as sk_live_ if needed and set how many tokens to generate, from 1 to 20.
Run the generation: each token appears in the list, ready to copy into your configuration or secrets manager.
Generate a 32-byte Base64URL key with a prefix such as myapp_live_, show it to the customer once and keep only its SHA-256 hash on the server.
GitHub, Stripe and Shopify sign their webhooks with a shared secret: generate one in hex, paste it into the provider's settings and into your app to verify the HMAC signature.
Generate several values at once for SESSION_SECRET, APP_KEY or JWT_SECRET to set up a development or staging environment with distinct secrets.
Aim for at least 128 bits of entropy, which is 16 bytes, and preferably 256 bits, which is 32 bytes, the default. That gives 43 characters in Base64URL or 64 in hex. Beyond that, the security gain is negligible and the key just gets bulkier.
All three represent the same bytes and offer the same security. Hex is the most readable and compatible, Base64 is more compact, and Base64URL is just as compact while staying safe in URLs, headers and file names. Follow the format expected by the service or library that will consume the token.
Yes, it is the cryptographic random generator exposed by the Web Crypto API, seeded by the operating system, like /dev/urandom or os.urandom. It is suitable for generating keys and tokens. Math.random, by contrast, is not designed for security and its output can be predicted.
A prefix tells what kind of key it is, for example secret or publishable, live or test, without revealing its value. It helps support and lets secret-detection tools recognize a key exposed in a Git repository. Stripe (sk_live_) and GitHub (ghp_) use prefixes for that reason.
A UUID v4 contains only 122 random bits and is primarily a unique identifier; some versions, such as v1 or v7, even include a predictable timestamp. For a secret, a random 32-byte token offers 256 bits of entropy and reveals nothing. Use a UUID to identify and a token to authenticate.
No: they are created in your browser and only exist on the page until you copy them. No token is transmitted or logged. Copy them straight into your secrets manager and close the page when you are done.
Related tools
Tools similar or complementary to this one.
Generate strong random passwords from 8 to 128 characters, with the entropy shown.
Generate a PKCE code_verifier, its S256 code_challenge and a state for your OAuth authorization request.
Compute an HMAC-SHA-1, SHA-256, SHA-384 or SHA-512 in hex or Base64 and verify a webhook signature.
Understand how OAuth 2.0, PKCE, JWT, JWK and JWKS fit together: authorization, tokens, public keys and verification.
Learn why covering text is not enough, how secure PDF redaction removes sensitive information and why sanitization matters before sharing.
Learn how to introduce a CSP progressively, understand its main directives, Report-Only mode, nonces and common mistakes.
Understand HSTS, CSP, X-Content-Type-Options, Referrer-Policy and Permissions-Policy and how to verify the headers actually returned.