PKCE verifier and challenge generator
Generate a cryptographically random code_verifier and its code_challenge for OAuth 2.0 PKCE.
PKCE verifier and challenge generator
This tool generates a PKCE code_verifier and its matching code_challenge for the OAuth 2.0 Authorization Code flow, following RFC 7636. It is built for developers wiring up single-page apps, mobile apps, or any public client that cannot safely hold a client secret and needs Proof Key for Code Exchange to protect the authorization code from interception.
The code_verifier is a cryptographically random string built only from the RFC 3986 unreserved characters (A–Z, a–z, 0–9, "-", ".", "_", "~"), between 43 and 128 characters long — choose the exact length with the slider. The challenge method controls how code_challenge is derived: S256 hashes the verifier with SHA-256 and base64url-encodes the digest, and is what every current OAuth guide and authorization server expects. The plain method just copies the verifier into the challenge unchanged; it exists in the spec for constrained clients that cannot compute SHA-256, offers no protection against interception, and this tool marks it accordingly.
The output includes the raw code_verifier and code_challenge, the method you chose, and a ready-made query string — code_challenge=...&code_challenge_method=... — that you can drop straight into an authorization request URL. Remember the verifier separately: it belongs in the later token request, not the authorization one, and a fresh pair should be generated for every login attempt rather than reused.
All generation happens locally in your browser, using the Web Crypto API's cryptographically secure random source and SHA-256 implementation — nothing is uploaded or logged anywhere. Click "Generate new pair" for a fresh verifier and challenge, copy the output, or download it as a .txt file.