Free browser tool · UTF-8 support · No account required
Base64 Encoder & Decoder
Convert text to Base64 or decode Base64 back to UTF-8 text. Chinese characters, accents and emoji are supported. Your input stays in this page.
🔒 100% Client-Side Processing: Your data never leaves your browser.
No uploads, analytics, external libraries or browser storage. Loading this page makes a normal website request; conversion needs no network connection. Base64 is encoding, not encryption.
Up to 1 MiB of UTF-8 text or decoded bytes; up to 2 MiB of pasted Base64 input. Standard Base64 only. ASCII spaces, tabs and line breaks in Base64 are ignored. Decoded output is plain text, never executed.
Enter text or load the sample to begin.
How to Encode and Decode Base64 Online
- Choose a direction. Select Text → Base64 to encode a message, or Base64 → Text to decode an encoded value.
- Paste your input. Enter the text or Base64 value in the left field. Load Sample supplies a Chinese-and-English example for the selected direction.
- Convert and check the result. Auto-convert updates after a short typing pause. You can also click Encode to Base64 or Decode to text. Errors identify the input line and column; Go to error selects the relevant character.
- Copy the output. Click Copy output. If clipboard access is blocked, the tool selects the output for Ctrl+C or Command+C. Clear empties both fields.
The encoder preserves spaces and line breaks in your text by encoding their UTF-8 bytes. The decoder ignores whitespace around or within the Base64 representation, but preserves whitespace in the decoded text.
Troubleshooting Base64 Conversion Errors
Invalid Base64 character
Paste only the encoded value. Remove a data:text/plain;base64, prefix before decoding. A - or _ belongs to the Base64url alphabet, which this tool does not accept. JSON quotes, punctuation and full JWTs also need to be removed or handled with the appropriate tool.
Invalid padding or incomplete input
= characters belong at the end, with no more than two. Missing padding is accepted when the remaining length is valid. A value with one character left over after dividing its length by four is incomplete; adding padding cannot recover missing data.
Valid: SGVsbG8= → Hello Also accepted: SGVsbG8 → Hello Invalid: S=GVsbG8
Decoded bytes are not valid UTF-8
The encoded value may represent an image, a compressed file or text in another encoding. This tool rejects invalid UTF-8 rather than silently replacing bytes with garbled characters. Use a binary decoder or the correct character encoding for that data. For UTF-8 errors, the selected position marks the Base64 quartet containing the offending byte.
Base64 syntax follows the standard alphabet and zero padding bits described in RFC 4648. Whitespace and omitted padding are accepted here as documented conveniences.
Base64 Converter FAQ
Does this tool upload or save my data?
No. Conversion runs in this page, without uploads, analytics, external libraries or browser storage. Clear removes both fields. Copy writes only the output to your clipboard when you request it. Loading the hosted page still makes a normal website request.
Can I encode Chinese text and emoji?
Yes. The encoder converts Unicode text to UTF-8 bytes before Base64 encoding. The decoder validates UTF-8, so Chinese characters and emoji survive a round trip without replacement characters.
Is Base64 encryption?
No. Base64 is a reversible encoding. Anyone with the encoded value can decode it; it does not protect passwords, tokens or other secrets.
Which Base64 formats are supported?
This tool uses the standard Base64 alphabet: A–Z, a–z, 0–9, + and /. It accepts correctly padded or unpadded input and ignores ASCII spaces, tabs and line breaks. It rejects misplaced padding and non-zero padding bits. Base64url, data URL prefixes and full JWTs are not supported.
Why is valid Base64 rejected as invalid UTF-8?
Base64 can represent any bytes, including images and compressed files. This converter outputs UTF-8 text only. Binary data or text encoded with another character set can be valid Base64 but cannot be decoded here as UTF-8 text.
Can I use it offline?
Yes, after saving the complete HTML page and opening it in a browser with JavaScript enabled. All conversion code and styles are inline. Clipboard access may be restricted for local files; use the manual copy fallback.