What is Base64?
Base64 is an encoding scheme that represents binary data as a sequence of printable ASCII characters. It uses a set of 64 characters (A–Z, a–z, 0–9, +, and /) plus the = padding character. Each group of three bytes of input becomes four Base64 characters in the output, making the encoded result approximately 33% larger than the original.
Common uses of Base64
Base64 is used wherever binary data needs to be stored or transferred over systems that handle text. Common examples include embedding images directly in HTML or CSS via data URIs, encoding file attachments in email (MIME), passing binary tokens in JSON payloads, and transmitting cryptographic keys and certificates. Basic HTTP authentication also uses Base64 to encode credentials.
How this tool works
For encoding, the tool uses the browser's TextEncoder API to correctly handle Unicode characters before calling btoa(), ensuring that characters outside the ASCII range are encoded properly. For decoding, it uses atob() followed by TextDecoder to reconstruct the original Unicode text. All processing happens locally in your browser — nothing is sent to a server.
Examples
The text Hello, World! encodes to SGVsbG8sIFdvcmxkIQ==. A common Base64-encoded JSON web token (JWT) header looks like eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. You can paste either of these into the input above and click Decode to see the original text.