What does this tool do
The Base64 Encoder Decoder converts text to Base64 and back. Encode any UTF-8 text (including emoji and non-Latin scripts) to Base64, or decode a Base64 string to plain text. Handles standard Base64 alphabet (A–Z, a–z, 0–9, +, /). All processing runs in your browser—no server upload.
How to use it
- Choose mode — Switch between Encode and Decode.
- Enter input — For Encode: type or paste text. For Decode: paste a Base64 string.
- View output — The result appears instantly. Invalid Base64 shows an error.
- Copy — Use the copy button to copy the output to the clipboard.
How it works
Encode: The input is encoded to UTF-8 via TextEncoder, then each byte is converted to the Base64 alphabet. The standard encoding uses 64 characters; padding (=) is added when needed. Decode: The input is validated (characters, length modulo 4), then decoded with atob and converted back to UTF-8 via TextDecoder. Invalid Base64 (wrong characters, bad length) returns an error. Input is limited to 500KB to avoid heavy main-thread work.
All computation runs entirely in your browser. No data is sent to any server.
Use cases & examples
- Data URLs — Encode small images or data for inline use.
- APIs — Decode Base64-encoded API responses.
- Email — Encode binary attachments for MIME.
- Storage — Encode binary-like data in text-only systems.
- Learning — Understand Base64 encoding and decoding.
Example
- Encode
Hello, 世界!→SGVsbG8sIOS4lueVjCE= - Decode
SGVsbG8gV29ybGQ=→Hello World
Limitations & known constraints
- Input size — Maximum ~500KB (512,000 characters) to prevent browser slowdown.
- Character set — Standard Base64 only; URL-safe Base64 (base64url) not supported.
- Binary — Optimised for text; for binary files, consider a dedicated tool.
- Empty decode — Empty input in decode mode returns an error.