URL-safe Base64

Encode or decode text as URL-safe Base64 (a variant without the '+', '/' or '=' characters), the format used in URLs, JWTs and query parameters.

Example:

How it works

Standard Base64 uses the '+' and '/' characters, which have a special meaning in a URL. The "URL-safe" variant replaces them with '-' and '_' and removes the '=' padding, so you can drop the result straight into a URL or an identifier without re-encoding it. This is exactly the format used for the sections of a JWT.

What's the difference from regular Base64?

Only the alphabet used for two characters ('-' instead of '+', '_' instead of '/') and the absence of '=' padding. The encoded data stays the same; only its text representation changes to be compatible with URLs.

Why does decoding sometimes fail?

If the string contains '+' or '/' characters (standard format) instead of '-' or '_', or if it has been truncated, decoding will fail. Check that the string you pasted really comes from a URL-safe Base64 encoding.

100% local processing: encoding and decoding run entirely in your browser via WebAssembly.