Base64 Encoder
Convert text into a standard Base64 ASCII representation for systems that require text-safe transport. The input is first represented as UTF-8, so Romanian characters, emoji, and other Unicode text round-trip correctly. Encoding is performed locally and the output is reversible; it is not encryption.
Runs locally — files stay on your deviceWhat is Base64 encoding?
Base64 represents bytes with an ASCII alphabet. It is reversible encoding, not encryption.
Base64 as binary-to-text encoding
Base64 groups binary data into six-bit values and maps them to a 64-character alphabet, with optional = padding at the end. Three input bytes normally become four Base64 characters, so output is typically about one third larger.
How it works
The tool converts the JavaScript string to UTF-8 bytes and encodes those bytes with the standard Base64 alphabet. The decoder can reconstruct the same Unicode text.
When to use it
- Place small binary or text values in an ASCII-only field.
- Create the payload portion of a data representation.
- Compare an expected Base64 value during integration debugging.
When not to use it
- Do not use Base64 to protect secrets.
- Do not expect compression; output is larger.
- Do not assume standard Base64 is URL-safe.
Worked examples
ASCII text
- Input
Invoice 1042- Expected output
SW52b2ljZSAxMDQy
Each ASCII character maps directly to one byte.
Romanian text
- Input
Bună ziua- Expected output
QnVuxIMgeml1YQ==
ă is encoded through its UTF-8 bytes.
JSON fragment
- Input
{"ok":true}- Expected output
eyJvayI6dHJ1ZX0=
Base64 preserves the exact text bytes, not the JSON meaning.
Common mistakes
Calling Base64 encryption
The alphabet is public and decoding is immediate. Correction: Use authenticated encryption when confidentiality is required.
Ignoring Unicode bytes
Direct btoa calls fail or corrupt characters outside a one-byte range. Correction: Encode text to UTF-8 bytes first, as this tool does.
Using standard Base64 in a URL unchanged
+ / and = may need special handling in URL components. Correction: Use a Base64url variant or component encoding when required.
Related operations and differences
Base64 Decoder
It reverses a valid Base64 string back to text.
URL Encoder
Percent encoding preserves URL syntax; Base64 replaces the entire byte sequence with another alphabet.
Limitations and privacy
- Base64 increases size and offers no integrity check.
- This page encodes text, not arbitrary uploaded files.
Processing uses browser APIs on this device; the entered content is not sent to the Toolbox server.
Frequently asked questions
Is Base64 encryption?
No. It is reversible binary-to-text encoding.
Why does Base64 end with equals signs?
Padding completes the final four-character group when the byte count is not divisible by three.
Why is the output larger?
Four six-bit characters represent each three bytes, plus possible padding.
Does it support Unicode?
Yes. This implementation encodes the text as UTF-8 before Base64 conversion.
References
- Base64 — MDN