Free URL-Safe Base64 Encoder
The URL-Safe Base64 Encoder converts text to Base64url format — the variant that replaces + and / with - and _ and strips padding, so it is safe to use in URLs and filenames.
URL-safe Base64 swaps + and / for - and _, which is why tokens use it — decode a real one with the JWT Verifier. For ordinary payloads, plain Base64 is more widely understood.
How to use the URL-Safe Base64
- 1 Paste the text you want to encode.
- 2 Choose whether to keep or strip the padding equals signs.
- 3 Copy the URL-safe output, which uses - and _ instead of + and /.
- 4 Switch direction to decode an existing URL-safe value.
URL and filename safe Base64URL encoding (RFC 4648 Section 5)
The URL-Safe Base64 tool encodes strings using the modified Base64URL alphabet specified in RFC 4648 Section 5. Standard Base64 uses the characters `+` and `/`, both of which have reserved functional meanings in web URLs (query delimiters and path separators) and require messy percent-encoding.
Base64URL replaces `+` with a hyphen `-` and replaces `/` with an underscore `_`, while conventionally omitting trailing padding `=` characters. This creates clean, compact strings safe for direct inclusion in URL query parameters, RESTful route paths, and JSON Web Tokens (JWT).
- Substitutes URL-problematic characters (+ and /) with URL-safe equivalents (- and _).
- Omits trailing padding equals signs to maintain compact, readable web URLs.
- Essential for crafting query string parameters, OAuth tokens, and JWT segments.
- Prevents URI parsing corruption and avoids double-encoding bugs across web proxies.
Frequently asked questions
Why does normal Base64 break in URLs?
Because its alphabet includes + and /. A plus is interpreted as a space in query strings, and a slash looks like a path separator, so the value is silently corrupted. URL-safe Base64 replaces them with - and _, which carry no special meaning.
Should I keep the padding equals signs?
It depends on the consumer. Standard Base64 uses = to pad to a multiple of four characters, but JWT and many URL parameters drop it because the length is already implied. When in doubt, keep it — decoders that expect it will fail without it.
Is Base64 a form of encryption?
No. It is an encoding, and anyone can reverse it instantly without a key. Its purpose is to carry binary data through text-only channels, such as email, JSON or a URL — never to hide anything.
Related Security & Cryptography Tools
You might also need
Tools from other categories that people pair with the URL-Safe Base64: