Generate cryptographically secure API keys, webhook secrets, and tokens. Pick the byte length, format, and optional prefix. Every key is created locally in your browser with crypto.getRandomValues, the same secure random source used for TLS and session tokens. Nothing leaves your machine.
Last updated:
The API Key Generator is a free security tool that creates cryptographically secure random keys using your browser's Web Crypto API. It supports hex, Base64, Base64URL, and alphanumeric output, lengths from 16 to 64 bytes, and optional prefixes like whsec_ or sk_live_ so leaked keys are easier to spot in logs. Generation runs locally with crypto.getRandomValues; no network request is made and no value is stored.
32 bytes (256 bits) is the standard for webhook secrets, JWT signing keys, and API tokens. 16 bytes is the minimum for production.
A prefix makes leaked keys easier to spot in logs and lets you scan repos for accidental commits.
Most online API key generators send your key to a server, log the result, or rely on JavaScript randomness that is not cryptographically secure. The first two leak the key before you ever paste it into your code; the third produces values an attacker can reproduce. A webhook secret generated by Math.random is functionally a public string, because the algorithm is deterministic and seedable. The same is true of Date.now mixed with Math.random, which is the most common pattern in "quick and dirty" key generation.
This tool uses crypto.getRandomValues, which reads from the operating system's cryptographically secure random source (CSPRNG). That is the same source the browser uses to generate TLS session keys, the same source Node.js uses for crypto.randomBytes, and the same source Stripe, GitHub, and OpenAI use to issue their own API keys. The output cannot be reproduced without compromising the underlying entropy pool, which is the whole point.
+, /, or =). Alphanumeric is for systems that reject special characters.whsec_ or api_v1_ makes the key trivially scannable in logs, source code, and secret-scanning tools. GitHub's secret scanning detects leaked tokens by their prefix patterns.crypto.getRandomValues, encodes the bytes in your chosen format, prepends the prefix, and renders the result. Nothing is logged. Nothing is sent. Closing the tab destroys the only copy.| Use case | Byte length | Recommended format | Notes |
|---|---|---|---|
| Stripe webhook secret | 32 | hex with whsec_ prefix | Matches Stripe's own format |
| JWT signing key (HS256) | 32 | Base64 or Base64URL | 256-bit entropy required for HS256 |
| Internal API key | 32 | hex or Base64URL with prefix | Use a prefix to enable secret scanning |
| CSRF token (per-session) | 16-24 | Base64URL | Short-lived, rotated frequently |
| Encryption key (AES-256) | 32 | Base64 (for env vars) | Exactly 32 bytes, never more or less |
| Magic link token | 24-32 | Base64URL | Hash before storing in the database |
Stripe Fee Calculator
Calculate Stripe fees for any payment method and currency.
RLS Policy Generator
Generate Supabase Row Level Security policies with templates.
SaaS Pricing Calculator
Find your break-even price and suggested pricing tiers.
OG Image Preview
Preview meta tags on Google, Twitter, LinkedIn, and more.
Security Checklist
30 essential security checks with scoring and progress tracking.
Tech Stack Costs
Compare hosting, database, and service costs at scale.
Security Headers
Generate Next.js security headers config with copy-paste code.
JWT Decoder
Decode and inspect JSON Web Tokens. View claims and expiry status.
JWT Generator
Build and sign JWTs with HS256, HS384, or HS512 in your browser.
CORS Config Generator
Generate CORS configuration for Next.js or Express with copy-paste code.
JSON to Zod Converter
Paste JSON and get a typed Zod schema with format detection.
Stripe Webhook Verifier
Verify Stripe-Signature headers with your webhook secret in your browser.
API Key Generator
Generate cryptographically secure API keys, webhook secrets, and tokens in your browser.
Skip months of boilerplate. SecureStartKit gives you auth, payments, email, and security best practices out of the box.
Get SecureStartKit