Use Base64 Text Encoder to convert the original Unicode string into UTF-8 bytes and then Base64. Decode the result as UTF-8 to verify round-trip integrity. Try Base64 Text Encoder.
Why Unicode and Base64 get confused
The word café contains a character outside seven-bit ASCII, while emoji can require four bytes in UTF-8. Base64 knows nothing about characters: it rearranges a byte sequence into printable ASCII characters. Different character encodings therefore produce different Base64 strings for what looks like the same text.
For café ☕, UTF-8 first encodes the characters into bytes; only then is Base64 calculated. If an older system instead treats each character as a single Latin-1 byte, the result may decode as corrupted text in a modern API.
- Record the encoding contract, not only the encoded string.
- Treat Base64 as transport encoding, never as a privacy measure.
Encode and verify with a round trip
Paste text into Base64 Text Encoder and run the conversion. Copy the result into Base64 Text Decoder and confirm the decoded string matches the original, including accents, spaces and punctuation. For a reproducible test, include both plain ASCII and at least one non-ASCII character.
When passing Base64 through JSON, keep the result inside a quoted string. If the API expects Base64URL instead, check whether it requires the URL-safe alphabet and omits padding; ordinary Base64 and Base64URL are related but not identical.
When Base64 is useful
Base64 is useful for text-only channels that cannot carry arbitrary byte values, such as some API fields or legacy data transports. It can also appear inside email attachments and data URLs, but those formats have additional conventions.
Encoding increases size: roughly four encoded characters represent three input bytes, plus possible padding. Do not Base64-encode large files just to make them smaller. For image bytes, use the dedicated Image to Base64 tool rather than a text encoder.
Avoid invisible corruption
A pasted value may contain a Unicode normalization difference, such as a composed accented letter versus a letter followed by a combining accent. Both display similarly but have different UTF-8 bytes. If a signature or checksum depends on exact bytes, normalization must be defined before encoding.
Never assume a Base64 string is safe to trust simply because it decodes. Decode input in the correct format, validate content, and avoid directly executing decoded HTML or scripts.
Common questions
Does Base64 protect sensitive text?
No. Anyone with the encoded text can decode it.
Can I use the text encoder for PNG files?
No. Use Image to Base64 to encode file bytes without treating them as Unicode text.