Base64 URL-Safe Converter | Standard and URL-Safe Side by Side
Encode text to standard Base64 and URL-safe Base64 at once, or decode either form back to UTF-8 text. Includes strip-padding and 76-character wrap options.
💡 About this tool
If you have ever dropped a Base64 string into a URL and watched the link break, you have hit the + and / problem. Standard Base64 (defined in RFC 4648 §4) uses +, /, and =, all of which carry special meaning in URLs, query strings, and filenames. The URL-safe alphabet from RFC 4648 §5 swaps + for - and / for _, so the string survives a URL without extra percent-encoding.
This converter shows the standard form and the URL-safe form side by side, which is handy when you are decoding a JWT header or eyeballing an OAuth state parameter and want to cross-reference the two notations. On the decode side, you can paste either variant: the tool normalizes -_ back to +/ and refills missing padding before decoding, so a stripped token still round-trips. Invalid byte sequences are caught by UTF-8 strict mode, so you get a clear error instead of mojibake.
🧐 Frequently Asked Questions
Q. What is the difference between standard and URL-safe Base64?
A. Only the 63rd and 64th characters differ. Standard uses + and /; URL-safe uses - and _. The other 62 characters (A-Z, a-z, 0-9) are identical.
Q. Can I decode a token after the = padding has been removed?
A. Yes. Base64 length is always a multiple of four, so the missing = can be inferred. This tool refills padding automatically before decoding.
Q. How do I handle a full JWT? A. A JWT has three dot-separated parts. Paste the header, payload, and signature one at a time. Each part is URL-safe Base64 with padding stripped.
Q. Does it handle emoji and non-ASCII text? A. Yes. Input is converted to UTF-8 bytes before encoding, so multi-byte characters round-trip correctly.
Q. When would I want the 76-character wrap? A. MIME email bodies historically wrap Base64 at 76 characters per line. Leave it off for URLs and tokens, where a single unbroken line is easier to copy.
📚 How Base64 actually works
Base64 maps every three bytes (24 bits) onto four printable characters by slicing the bits into 6-bit groups, which is why the output grows to roughly 4/3 of the input size. It is an encoding, not compression: the goal is to move binary data safely through text-only channels, not to shrink it.
RFC 4648 standardizes the whole family in one document: Base16 (plain hexadecimal), Base32, and Base64, plus the URL-safe variant. Because the alphabets are formally specified, two systems that both follow the RFC agree on the output for the same input.