Base64 Encoder & Decoder
Encode and decode text locally.
Encode and decode text locally.
Base64 turns arbitrary bytes into a limited alphabet of letters, digits, plus and slash so the data can travel through systems built for plain text. You meet it in email attachments, data URIs, HTTP Basic authentication headers, configuration files, and the segments of a JWT. This page gives you two buttons, Encode and Decode, and a single text box for the input.
Text is converted to UTF-8 bytes before encoding, and decoded bytes are read back as UTF-8. That matters because the browser's built-in btoa function only handles Latin-1 characters and throws an error on anything else. Here, a word like cafe with an accent, a Japanese sentence, or an emoji encodes and decodes correctly instead of failing.
Keep one thing in mind: Base64 is a representation, not a protection. Anyone can reverse it in a second, so it should never be used to hide passwords or tokens. It also makes data roughly one third larger, which is the price of using only safe characters.
A Kubernetes secret, an environment file, or an API response contains a long string ending in an equals sign. Paste it, press Decode, and see whether it holds readable text such as a connection string or JSON before you decide how to handle it.
HTTP Basic authentication sends username:password as Base64. Type the pair with a colon between them, press Encode, and add the result after the word Basic in your header when testing an endpoint with a command-line client.
Text parts of a MIME message and small inline data URIs are often Base64. Paste only the encoded portion without headers or the data:text/plain;base64 prefix, and Decode will show the original text if it was UTF-8.
When you need to place multi-line text or special characters into a JSON field, a query string, or a script that mangles quotes and line breaks, encoding it first gives you one clean line of safe characters.
Encoding and decoding run in your browser using standard built-in functions. The text you enter is not sent to a server by this tool.
No. Base64 is a reversible encoding with no key and no secret, so anyone who sees the string can decode it instantly. It exists to make binary or special-character data safe to transmit as plain text. If you need confidentiality, use real encryption, and treat Base64 output as if it were the original data.
Base64 works in groups of three bytes that become four characters. When the input length is not a multiple of three, the output is padded with one or two equals signs so the total length stays a multiple of four. The padding carries no data of its own.
Every three bytes of input become four characters of output, so the result is about one third larger. Non-ASCII characters add more, because an accented letter takes two UTF-8 bytes and many emoji take four before encoding begins.
The usual causes are a copied prefix, extra quotation marks, a string cut off in the middle, or characters outside the standard alphabet such as hyphens and underscores from the URL-safe variant. Trim the string to just the encoded characters and try again.
Not in a useful way. The tool shows the decoded bytes as text, which is meaningless for images, PDFs, and other binary files. It is meant for readable text such as JSON, credentials in test setups, and configuration values.
Yes. Input is converted to UTF-8 before encoding and read back as UTF-8 when decoding, so non-English text round-trips correctly. Be aware that other tools which assume Latin-1 may produce a different Base64 string for the same text.