Base64URL vs Base64
Base64URL is Base64 with + replaced by -, / replaced by _, and the = padding usually omitted. It is the form used in URLs, filenames and JWTs.
Last reviewed 2026-11-04.
never leaves your browser
Worked example
The text subjects?_d>>> encodes to:
| Variant | Output |
|---|---|
| Base64 | c3ViamVjdHM/X2Q+Pj4= |
| Base64URL | c3ViamVjdHM_X2Q-Pj4 |
Tick "URL-safe" in the tool to switch. The 62nd and 63rd characters differ and the padding goes.
Differences
- Alphabet: Base64 uses
+and/; Base64URL uses-and_. Both useA-Z a-z 0-9for the rest. - Padding: standard Base64 pads with
=to a multiple of 4; Base64URL typically omits it (RFC 7515 for JWT requires omitting it). +,/and=have special meaning in URLs and query strings, which is why the URL form exists.
Converting by hand
To go from Base64URL to Base64: replace - with +, _ with /, then add = until the length is a multiple of 4. A JWT header or payload is Base64URL; see how to decode a JWT.
Running this on a server
If you generate tokens or links on a server, the hosting guide compares small hosts.
Frequently asked questions
Can a Base64 decoder read Base64URL?
Not always. Strict decoders reject - and _. Convert the alphabet first, or use a Base64URL-aware decoder.
Is Base64URL shorter?
Slightly, because the padding is dropped.
Which does a JWT use?
Base64URL without padding for all three parts.
Sources
- RFC 4648 section 5: Base 64 Encoding with URL and Filename Safe Alphabet checked 2026-11-04
- RFC 7515: JSON Web Signature, Base64url Encoding checked 2026-11-04