URL-safe Base64
Why standard Base64 breaks URLs and how the URL-safe alphabet fixes it.
Standard Base64 uses + and /, which change meaning inside a URL or filename. URL-safe Base64 substitutes - and _ and can omit padding, so the encoded value survives transport unchanged.
01Alphabet differences
- Standard alphabet: A-Z, a-z, 0-9, +, /.
- URL-safe alphabet: A-Z, a-z, 0-9, -, _.
- Padding = may be dropped when the length is known from context.
Decode with the same alphabet
Decoding URL-safe data with a standard decoder silently produces wrong bytes. Match the alphabet on both ends.
02Limitations
URL-safe Base64 changes the alphabet only. It does not reduce the size overhead and provides no confidentiality.
Sources
- RFC 4648: The Base16, Base32, and Base64 Data Encodings — IETF (accessed 2026-09-01)
Test this in your browser
The tool runs entirely in your browser; the input you use never leaves it.
About the author
Gampangin builds and maintains free, browser-based developer tools and the documentation that makes them trustworthy. The organization is accountable for every page published on this site.