How base64 encoder & decoder works
Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is used to safely transmit data over channels that only accept text, like email attachments (MIME), data URIs in HTML, and JSON Web Tokens.
This tool encodes any text you enter into Base64 using the standard alphabet, or decodes an existing Base64 string back to text. Encoding increases the size by roughly 33% (every 3 bytes becomes 4 characters). The padding character (=) is added at the end when the input length is not a multiple of 3.
Base64 is an encoding, not encryption. It provides no security or confidentiality. Anyone can decode it. Use it for data transport, not for protecting secrets. All processing happens in your browser using the built-in btoa and atob functions.
Frequently asked questions
What is Base64 used for?
Base64 is used to encode binary data as text so it can be safely transmitted over text-only channels like email (MIME), embedded in HTML/CSS as data URIs, or included in JSON. It is also used in JWT tokens and basic HTTP authentication.
Is Base64 encryption?
No. Base64 is an encoding, not encryption. It provides no security. Anyone can decode a Base64 string. Do not use it to protect secrets; use it for data transport and storage format compatibility.
Why does Base64 make text longer?
Base64 encodes every 3 bytes of input as 4 characters of output, so the result is about 33% larger than the original. Padding (= characters) is added when the input length is not a multiple of 3.
Can I encode and decode UTF-8 text?
The standard encoder works with ASCII and Latin-1 characters. For full UTF-8 support (emoji, non-Latin scripts), the text is first encoded to UTF-8 bytes, which the browser handles automatically for most common text.