← All text tools

PKCE Code Verifier and Challenge Generator

Generate a random code verifier and its S256 code challenge in the base64url format OAuth 2.0 servers expect, ready for PKCE testing and development.

  • Free
  • No sign-up
  • Works on any device

About PKCE Code Verifier and Challenge Generator

PKCE (RFC 7636) protects the OAuth 2.0 authorization code flow when the client cannot keep a secret, such as a single-page or mobile app. Your app makes a random code verifier of 43 to 128 characters, sends only its SHA-256 hash (the code challenge, base64url without padding) in the authorization request, and sends the verifier itself when it exchanges the code. This page makes both with secure randomness. Paste your own verifier to check a known pair: the RFC example dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk gives E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM.

How to use PKCE Code Verifier and Challenge Generator

  1. Leave the verifier box empty and pick a length from 43 to 128, or paste a verifier you already have.
  2. Copy the code_challenge and code_challenge_method=S256 values into your authorization request.
  3. Keep the code_verifier in your app and send it in the token request that exchanges the code.

Why use this tool?

Also known as

Frequently asked questions

What characters may a code verifier contain?

Only the unreserved characters: letters, digits, hyphen, period, underscore and tilde, with a length of 43 to 128. Anything else is rejected by the authorization server.

Should I use S256 or plain?

Use S256 whenever the client can hash, which is almost always. The plain method sends the verifier itself as the challenge and only exists for very limited clients. Some servers refuse it.

Can I reuse one verifier for several logins?

No. Create a fresh verifier for every authorization request. Reusing one removes the protection, because anyone who saw an earlier challenge or code could replay it.

Is PKCE Code Verifier and Challenge Generator free?

Yes. PKCE Code Verifier and Challenge Generator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.