A Base64 encode decode tool converts text to RFC 4648 Base64 or converts Base64 back to text, while correctly handling UTF-8 accents, Chinese characters, and emoji.
The Base64 Encode / Decode tool provides a direct text workflow: select the conversion direction, paste your input, and read the result in the output box. Every conversion happens locally in your browser, so the text you enter is not sent to a server.
This guide focuses on the supported text workflow, the role of UTF-8, the standard alphabet and padding rules, and the situations in which Base64 commonly appears.

Choose the conversion direction
Encoding and decoding are inverse operations, but they require different starting input. Choose Encode when you have ordinary text and need its Base64 representation. Choose Decode when you already have a Base64 string and want to recover the text it represents.
| Action | Input | Output | Text handling |
|---|---|---|---|
| Encode | Text | RFC 4648 Base64 | Text is first converted to UTF-8 bytes. |
| Decode | Base64 | Text | Decoded bytes are checked with a strict UTF-8 decoder. |
Choose the direction by looking at the data you already have, not by the result you hope to obtain. A Base64 string normally contains only letters, digits, “+”, “/”, and padding characters marked with “=”. Ordinary prose, punctuation, spaces, and non-Latin characters indicate that the input still needs to be encoded.
Run the converter in the right order
The text conversion requires only three actions. The output updates as you type or paste, so there is no separate conversion button to press.
- Choose a direction. Select Encode for text to Base64 or Decode for Base64 to text.
- Type or paste your input. Place the string in the input box. The result appears instantly in the output box below as the input changes.
- Copy or continue. Click Copy to place the result on your clipboard, or use Swap direction to feed the result straight back through the converter.
The real-time output makes it easy to check the result before leaving the page. Copy the complete value when passing it to an application, including any required padding. The encoding implementation works byte by byte, which allows large inputs to be processed without the stack overflow that can affect implementations built around repeated nested string operations.
Swap is particularly useful for a quick round-trip check: encode a short string, swap the direction, decode the result, and compare the recovered text with the original. This confirms that no characters were lost during the round trip.
Handle UTF-8 text correctly
UTF-8 is the part that many basic Base64 examples overlook. A browser’s raw btoa() function accepts only Latin-1 characters with code points from 0 through 255. It throws an error when it receives text such as “café”, “你好”, or an emoji. Treating those characters as single Latin-1 values would also produce incorrect bytes.
This tool avoids that limitation by encoding the text as UTF-8 bytes with TextEncoder before applying Base64. Characters outside ASCII are represented by the correct multi-byte UTF-8 sequence, and those bytes are then converted to Base64. During decoding, the process is reversed: Base64 becomes bytes, and a strict UTF-8 decoder checks whether those bytes form valid text.
That strict check matters because malformed bytes should not be turned into a misleading result. If decoded bytes are not valid UTF-8, the tool rejects them instead of silently producing garbage. This also means the text decoder is intended for UTF-8 text, not as a general-purpose extractor for every kind of binary file.
Read the alphabet and padding rules
Standard Base64 uses the alphabet defined in RFC 4648 §4: uppercase letters from A through Z, lowercase letters from a through z, digits from 0 through 9, plus “+”, and forward slash “/”. The tool follows that standard, including its padding behavior.
Base64 groups three input bytes, representing 24 bits, into four Base64 characters. When the input contains fewer than three bytes, the encoded output receives one or two “=” characters. These padding markers keep the encoded length a multiple of four, as required by the standard.
Worked example: The character “f” occupies one UTF-8 byte. Base64 encodes the available bits and adds two padding characters, producing “Zg==”. The final equals signs are required parts of the encoded value rather than decorative symbols.
Do not remove trailing padding when copying a result into a system that expects standard Base64. Likewise, copy the entire output rather than editing individual characters by sight. If a received string appears to be missing its final padding, restore the required “=” characters or obtain the value again from its source instead of guessing.
Recognize common Base64 use cases
Base64 is used whenever binary or non-text data must be carried through a system that expects text. Its purpose is representation and transport, not concealment.
| Context | What Base64 does | Practical check |
|---|---|---|
| data: URIs | Carries image or font bytes inside an HTML or CSS resource. | Keep the required URI prefix and MIME metadata separate from the encoded payload. |
| MIME email attachments | Represents attachment bytes in message content. | The decoded result may be binary rather than readable UTF-8 text. |
| JSON Web Tokens | JWTs contain three dot-separated encoded segments. | Confirm the Base64 variant expected by the system before decoding a segment. |
| Basic HTTP authentication | Encodes the credential string used in the header value. | Decoding reveals the credentials because Base64 provides no secrecy. |
| JSON API payloads | Carries binary bytes as a JSON string. | Copy the complete encoded value, including required padding. |
The tool described here produces standard RFC 4648 Base64 with the “+” and “/” alphabet. A system that specifically requests a URL-safe variant may require different handling, so do not assume that every encoded segment can be copied directly between standards.
Separate local processing from encryption
Local processing and confidentiality solve different problems. Because this encoder and decoder runs entirely in your browser, pasted text never leaves your device and is not uploaded for conversion. That makes the workflow suitable for handling sensitive text without sending it to a remote processing service.
Base64 itself, however, is not encryption. It uses a public, reversible alphabet with no secret key. Anyone who has the encoded value can decode it, and the padding and character substitutions do not conceal the original content. Never use Base64 to protect passwords, API secrets, or other confidential data by itself.
Once an encoded value is copied into an email, configuration file, API request, or website, it should be treated as readable data. Local conversion prevents an upload during encoding or decoding; it does not change the security properties of the resulting Base64 string.
Check the result before using it
A short final check can catch most avoidable problems:
- Confirm that Encode or Decode matches the form of your input.
- For encoding, make sure the original text is complete and contains no accidental spaces added for formatting.
- For decoding, copy every Base64 character, including required “=” padding.
- If decoded content is rejected, confirm that the original Base64 was not truncated or altered and that its bytes represent valid UTF-8 text.
- Treat the result as encoded data, not as encrypted or secret material.
When the direction, character set, and padding are correct, the conversion is straightforward: paste the text, select the appropriate mode, and copy the live output. The browser-based Base64 Encode / Decode workflow keeps that process local while handling multilingual text and emoji correctly.
For a deeper look, see Base64 to Hex Tips and Common Mistakes.
For a deeper look, see How to Avoid Mistakes Using a Binary to Text Converter.