For text, the reliable path is Unicode text → UTF-8 bytes → Base64. Reverse those steps to decode it. TestiFollow handles that conversion locally for readable UTF-8 text.
Written and reviewed by TestiFollow. Checked against the current tool on 20 November 2026.
Open Base64 Encoder/DecoderEncode or decode text in a few steps
- Open the Base64 Encoder/Decoder.
- To encode, enter readable text and choose Encode to Base64.
- To decode, paste standard Base64 and choose Decode to text. Paste the encoded value itself, without quotation marks or a
data:prefix. - Check Result, then choose Copy result. If clipboard access is unavailable, select and copy it manually. There is no file-download or binary-file mode.
Input changes clear the previous result; Clear removes both fields. A failed conversion clears the result and disables its copy button. The examples below can be pasted directly, without an extra newline.
What Base64 does, and what it does not do
Base64 represents bytes using a restricted text alphabet. It is useful when a protocol or field requires binary content to travel as text. It is reversible without a secret key: encoding is not encryption. It is not a password hash, compression method or access-control mechanism.
Text needs an agreed character encoding before those bytes have a meaning. TestiFollow uses UTF-8. Base64 from a different text encoding may fail here even when its Base64 syntax is correct.
For ordinary data, Base64 uses roughly four output characters for every three input bytes, plus any final padding. It generally makes a payload larger. Use it when the receiving format requires it, not to make JSON shorter or hide confidential content. The standard alphabet, padding and URL variant are defined in RFC 4648.
Working examples: ASCII, accents, emoji and non-Latin text
Each pair below shows the text on the first line and its standard UTF-8 Base64 on the second. Encode the first line or decode the second; do not paste both lines together.
Ordinary ASCII
Hello
SGVsbG8=
An accented character
Café
Q2Fmw6k=
An emoji
😀
8J+YgA==
Non-Latin text
你好
5L2g5aW9
A trailing space or line break is real data when you encode and changes the result. For example, Hello and Hello followed by a newline do not have the same encoding. When decoding, this tool ignores ordinary spaces, tabs, carriage returns, line feeds and form feeds within the encoded input.
Why naive browser Base64 can break Unicode
Browser btoa() treats its input as byte values, not as arbitrary Unicode text. Passing an emoji directly can throw an out-of-range error. Accented characters can be subtler: btoa("Café") returns Q2Fm6Q==, but that treats é as a single byte rather than the UTF-8 byte sequence used in the correct example above. TestiFollow's UTF-8 decoder rejects that result.
Similarly, atob() returns a binary string. Treating it directly as decoded Unicode can show garbled characters rather than the intended name or message. Convert through bytes instead. MDN's btoa documentation explains this distinction.
The correct conceptual sequence is:
Encode: Unicode text → UTF-8 bytes → Base64
Decode: Base64 → bytes → UTF-8 text
TestiFollow uses TextEncoder for the first step and TextDecoder("utf-8", { fatal: true }) for the final step. Fatal decoding rejects invalid UTF-8 rather than silently replacing bad bytes. Encoding and decoding therefore agree on the character encoding for ordinary Unicode text.
A UTF-8-safe JavaScript example
For a small value, this browser example performs the same essential conversions. Its decoder deliberately leaves Base64 parsing to atob; it does not reproduce all of TestiFollow's input checks or limits.
const text = "Café 😀";
const bytes = new TextEncoder().encode(text);
const binary = Array.from(bytes, byte =>
String.fromCharCode(byte)
).join("");
const encoded = btoa(binary);
const decodedBytes = Uint8Array.from(
atob(encoded),
character => character.charCodeAt(0)
);
const restored = new TextDecoder("utf-8", {
fatal: true
}).decode(decodedBytes);
console.log(restored === text); // true
This example is for small strings, not a streaming file encoder. TestiFollow itself processes encoding byte chunks to avoid passing a huge array as function arguments. TextEncoder produces UTF-8 bytes; it is not a detector for the encoding of existing binary data. See TextEncoder and TextDecoder.
Understand padding and URL-safe Base64
Standard Base64 uses letters, digits, + and /. An ending = or == is padding, not part of the original text. Some values need no padding. TestiFollow accepts supported unpadded final groups too: SGVsbG8 decodes to Hello, just like SGVsbG8=. A one-character value such as A is incomplete and is rejected; adding arbitrary = characters does not repair missing data.
Base64url replaces + and / with - and _. TestiFollow has no dedicated URL-safe mode and rejects those alternative characters. Values containing only the shared letters and digits can look identical, so a successful decode does not identify their variant. Use the variant required by your protocol rather than assuming every Base64-looking value is interchangeable.
Diagnose the error you see
“Enter valid Base64 text…”
Check for punctuation, quotation marks, URL-safe characters, incorrect padding or a truncated value. not base64! fails syntax validation. A full data URL such as data:text/plain;base64,SGk= also fails; the tool does not parse its prefix. Do not strip characters randomly from an unknown value.
“This Base64 does not contain readable UTF-8 text…”
The alphabet can be correct while the decoded bytes are unsuitable for this text decoder. /w== represents byte FF, which is not valid UTF-8 by itself. The data could be a binary file, compressed content, another text encoding or damaged input. This error does not prove that the original Base64 is invalid. Use a tool appropriate to the source format rather than repeatedly re-encoding it.
“Use 500,000 characters or fewer” or an oversized-paste warning
The input limit is 500,000 JavaScript string units; many emoji occupy two units. Encoded output is not subject to the same field limit and can be too long to paste back for decoding. For example, 500,000 ASCII letters encode to 666,668 Base64 characters. Use a suitable file or streaming workflow for large payloads instead of assuming every maximum-size output will round-trip through the input field.
When to use the decoded result
Only Base64-decode content you are authorized to inspect. Decoding is not a safety check: readable output can still contain untrusted HTML, code or misleading instructions. Do not execute it just because it decoded successfully.
If the result is JSON, use the JSON formatting and validation guide and JSON Formatter to inspect its structure. Formatting checks syntax; it does not authenticate a message or verify a token signature. For other tasks, return to Text & Developer tools.
Privacy and frequently asked questions
Does TestiFollow send my input to a server?
No. Current encoding and decoding run locally in the browser. Normal page/asset requests and optional coarse first-party action counts are separate; the tool input is not included in them. Fields are cleared when leaving the page. Your clipboard, extensions and device security remain outside that promise. See the privacy notice.
Will this decode any Base64 file?
No. It is a text tool, not a file decoder. Valid UTF-8 can still contain control characters that are not useful readable text. Binary formats need their own handling even if some of their bytes happen to decode.
Is every possible byte sequence preserved?
No. The text workflow interprets bytes as UTF-8. The default decoder removes an initial UTF-8 byte-order mark, and encoding a JavaScript string with an unpaired surrogate replaces that malformed sequence. It is not a byte-preserving archive or a repair tool. These behaviors follow the Encoding Standard.
Should I use Base64 to protect a password or private API key?
No. Anyone with the encoded value can reverse it. Follow the receiving system's security requirements, and do not paste real credentials merely to try an example.