OAuth PKCE Generator
Turn a PKCE code verifier into its S256 challenge with WebCrypto, or generate a verifier from the browser's random bytes.
What the OAuth PKCE Generator does
The challenge is computed with crypto.subtle.digest('SHA-256', …) and encoded as base64url without padding, which is exactly what RFC 7636 defines for the S256 method. The worked example on this page is the RFC's own Appendix B vector.
The verifier is checked against the specification's alphabet — A-Z, a-z, 0-9, hyphen, dot, underscore, tilde — and its 43 to 128 character length, so a truncated paste is refused before the challenge is computed.
plain is not offered: it sends the verifier itself as the challenge and is only a fallback for clients that cannot hash. This page does not exchange the code or hold a token; it produces the pair and forgets it.
How to use it
Paste a code verifier into the Code verifier box and press Run, or leave it empty and press Run to generate one.
The PKCE pair below shows the verifier, its challenge and the method; the Generated line says whether the page made the verifier.
Check the PKCE pair method line — it says S256, which is the only method worth using.
Worked example
Input:
dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
Output:
verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
method: S256
Generated: no — you supplied the verifier
Why it runs in your browser
The result is produced on this page with JavaScript, so it works offline after the page loads and nothing you enter is sent anywhere.
The PKCE pair an authorization request needs: a verifier that satisfies RFC 7636's character set and length, and the `BASE64URL(SHA-256(verifier))` challenge.
Leave the box empty to have the page generate a verifier from the browser's own random bytes, or paste yours to get the challenge for a verifier you already have.
What it does, and what it does not
The challenge is computed with `crypto.subtle.digest('SHA-256', …)` and encoded as base64url without padding, which is exactly what RFC 7636 defines for the S256 method. The worked example on this page is the RFC's own Appendix B vector.
The verifier is checked against the specification's alphabet — A-Z, a-z, 0-9, hyphen, dot, underscore, tilde — and its 43 to 128 character length, so a truncated paste is refused before the challenge is computed.
`plain` is not offered: it sends the verifier itself as the challenge and is only a fallback for clients that cannot hash. This page does not exchange the code or hold a token; it produces the pair and forgets it.
How to use OAuth PKCE Generator
Paste a code verifier into the Code verifier box and press Run, or leave it empty and press Run to generate one.
The PKCE pair below shows the verifier, its challenge and the method; the Generated line says whether the page made the verifier.
Check the PKCE pair method line — it says S256, which is the only method worth using.
What to Expect
Best for
- Producing a PKCE pair for an authorization request
- Computing the challenge for a verifier you already generated
Not ideal for
- The plain method, which sends the verifier itself
- Storing or exchanging a token, which this page never does
What this tool keeps
- The verifier exactly as supplied
- The challenge as unpadded base64url
What may need cleanup
- Keep the verifier for the token request by hand
- A client that cannot hash needs a different flow
Common errors
- The page refuses it: a PKCE verifier is 43-128 characters
Example use cases
- Testing an authorization request by hand
- Checking a challenge you computed elsewhere
Sample input
Code verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
Sample output
PKCE pair: verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk …
Who this is for
- Developers implementing OAuth 2.0 with PKCE
- Anyone debugging a code exchange
Frequently asked questions
Why is the challenge base64url without padding?
That is what RFC 7636 defines for S256: SHA-256 of the verifier, encoded as base64url with the = padding removed. A padded value would not match.
Where does a generated verifier come from?
32 bytes from crypto.getRandomValues, encoded as base64url. That is 43 characters, the minimum length the specification allows.
Is the verifier stored anywhere?
No. It exists in the output box and nowhere else; the page keeps no state and makes no request.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.