Base64 Encoder and Decoder
Encode text to Base64 or decode it back, with UTF-8 handled correctly and an option for the URL-safe alphabet used in JWTs.
Free · No sign-up · Your inputs stay in your browser
Input
Encode text as Base64
Output
28 characters
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Base64 is an encoding, not encryption
Anyone can decode it. It exists to carry bytes through channels that only accept text: email bodies, JSON fields, data URLs and HTTP Basic authentication headers. Never use it to hide a secret.
Standard versus URL-safe
The standard alphabet uses + and /, which have meaning in URLs. The URL-safe alphabet from RFC 4648 section 5 swaps them for - and _, and JWTs also drop the = padding.
Why btoa() throws on emoji
The browser's btoa() only accepts characters in the Latin-1 range. This tool encodes the text as UTF-8 first, which is also what PHP's base64_encode() and Node's Buffer.from(text).toString("base64") do with a UTF-8 string.