Base64 Encoder & Decoder

Encode plain text to Base64 or decode Base64 strings back to readable text.

What is Base64?

Base64 is an encoding scheme that converts binary data into a string of ASCII characters. The name comes from the fact that it uses 64 printable characters (A through Z, a through z, 0 through 9, plus + and /) to represent data. For every 3 bytes of input, Base64 produces 4 characters of output, making the encoded version about 33% larger than the original.

Base64 is not encryption. It does not make data secret. It is purely an encoding method that allows binary data to be safely transmitted in systems that only handle text, such as email bodies, HTML attributes, and JSON fields.

Common uses for Base64

Data URIs: Embedding images directly in HTML or CSS without a separate file request. For example: src="data:image/png;base64,iVBORw0KGgo...". This avoids an extra HTTP request but increases the HTML file size.

HTTP Basic Authentication: When a browser or client sends a username and password using HTTP Basic Auth, it encodes them as Base64. The header looks like: Authorization: Basic dXNlcjpwYXNzd29yZA==. This is why Basic Auth requires HTTPS, since the encoding is trivially reversible.

JSON Web Tokens (JWT): JWTs consist of three Base64-encoded sections separated by dots: a header, a payload, and a signature. Pasting a JWT into the decoder reveals the header and payload as readable JSON.

Email attachments: The MIME standard uses Base64 to encode binary file attachments so they can be transmitted as plain text through email servers.

Debugging API responses: Some APIs return Base64-encoded data. Decoding it reveals the original content, which is useful for troubleshooting.

Frequently asked questions

Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. Anyone who receives a Base64 string can decode it in seconds without any key or password. Never use Base64 to protect sensitive information. Use proper encryption algorithms for security.
Why does Base64 output end with == sometimes?
Base64 encodes every 3 bytes into 4 characters. When the input length is not a multiple of 3, padding characters (=) are added to the end to complete the last group. One = means one byte of padding, and == means two bytes of padding.
Why does my decoded text look like gibberish?
Base64 decoding assumes the original data was text. If the original content was binary data (like an image or a compiled file), decoding it as text will produce unreadable characters. Base64 is only useful for round-tripping text that was originally text.
Does this tool handle Unicode characters?
Yes. The encoder converts Unicode text to UTF-8 bytes before encoding, so characters outside the basic ASCII range are handled correctly. The decoder reverses this process.