1. Home
  2. Developer tools
  3. PKCE Code Verifier and Challenge Generator

PKCE Code Verifier and Challenge Generator

Create the pair of values a public OAuth client needs, or test a challenge calculation against your own implementation.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use PKCE Code Verifier and Challenge Generator

  1. Press Generate, or paste your own verifier.
  2. Copy the verifier and challenge.
  3. Use the challenge in the authorization request and the verifier when exchanging the code.

Features

  • Verifier of 43 to 128 characters from the allowed alphabet
  • S256 and plain methods
  • Matches the RFC 7636 example
  • Ready-made authorization URL parameters
  • Generated with the secure random generator
  • Runs in your browser

Supported formats

You get

  • Code verifier
  • Code challenge
  • Authorization parameters

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the PKCE Code Verifier and Challenge Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Values are for testing; production clients should generate a fresh pair for each request in their own code.
  • It does not perform the OAuth flow itself.

Guide

PKCE for OAuth: code verifier, S256 challenge and the full flow

OAuth 2.0 lets an application get access to your data at another service without seeing your password. In the authorization code flow, the user signs in at the provider, which then redirects back to the app with a short-lived code that the app exchanges for tokens. For apps that cannot keep a secret, such as mobile apps and single-page applications, that code can be stolen in transit. PKCE, Proof Key for Code Exchange (RFC 7636, pronounced “pixy”), closes the hole, and OAuth 2.1 requires it for all clients. This page produces the two values the flow needs and shows where each goes.

How it works

Before sending the user to the provider, the app makes a random code verifier and keeps it. It sends only a derived value, the code challenge, in the authorization request. When it comes back with the code, it also sends the original verifier in the token request. The provider hashes the verifier and compares the result with the challenge it stored. An attacker who steals the code does not have the verifier, and a hash cannot be reversed, so the stolen code is useless.

The allowed shape

The verifier must be between 43 and 128 characters long and use only the unreserved URL characters: letters, digits, hyphen, period, underscore and tilde. The recommended way is 32 random bytes encoded in Base64URL, which gives 43 characters. The page lets you generate a verifier of a chosen length, 64 being a good choice, from the secure random generator, and checks a verifier you paste for length and characters. A new verifier must be created for every authorization request.

A worked check

Press “Sample (RFC 7636 example)”. The verifier is dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk, taken from Appendix B of the RFC. The page computes the SHA-256 of its 43 ASCII characters, encodes it in Base64URL without padding, and shows the code challenge E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM with the method S256, which is exactly the value printed in the RFC. If your own library gives a different challenge for the same verifier, check that it hashes the ASCII text and not a Base64-decoded version, and that it strips padding.

The two requests

With an endpoint, client ID, redirect URI and scope filled in, the page writes the authorization URL, for example https://auth.example.test/authorize?response_type=code&client_id=my-client-id&redirect_uri=…&scope=openid+profile&state=RANDOM_STATE&code_challenge=E9Melho…&code_challenge_method=S256, and a curl command for the token request that carries code_verifier. Replace the state value with a fresh random string and keep checking it when the user returns, since PKCE does not replace it.

Choosing S256

Use S256 whenever the provider supports it. The plain method puts the verifier itself in the authorization request, where interception would reveal it, and exists only for clients that cannot compute a hash. Most modern providers require S256.

Limits

The page produces values for testing and learning, not for a production flow, where your own code should make a new pair for each request. It does not talk to any provider or perform the login. Everything is generated in the browser.

Checked against the current version of the PKCE Code Verifier and Challenge Generator on .

Frequently asked questions

Why does a single-page app or a mobile app need PKCE?

These clients cannot keep a client secret, so anyone who intercepts the authorization code, for example through a malicious app registered for the same redirect scheme, could exchange it for a token. PKCE ties the code to a one-time secret that only the genuine client knows.

Does PKCE help for a server-side web app that has a client secret?

Yes. OAuth 2.1 and current security guidance recommend it for every client, because it also blocks authorization-code injection and costs almost nothing to add.

Should I use S256 or plain?

Use S256 whenever the server supports it. The plain method sends the verifier itself and is only a fallback for clients that cannot hash.

Can I reuse a verifier for several logins?

No. Create a new verifier for every authorization request and discard it after the code exchange.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.