Base64 Encoder: Complete Usage Guide
Encode and decode Base64 with correct UTF-8 handling — locally, with nothing sent to a server.
Open the toolPurpose
Base64 re-expresses binary data as 64 safe ASCII characters so it can travel through channels built for text: email bodies, JSON payloads, data URIs, HTTP headers and certificate files. This tool encodes and decodes in both directions and handles UTF-8 correctly, so accented characters, non-Latin scripts and emoji round-trip cleanly instead of throwing the InvalidCharacterError that raw btoa() produces.
How to use it
- 1Choose Encode or Decode.
- 2Paste your text or Base64 string into the input panel.
- 3Read the result in the output panel — it updates as you type.
- 4Copy the output. If decoding fails, the error message explains why.
Tips & tricks
- Base64 output is about 33% larger than the input. Budget for that before embedding files in JSON or HTML.
- Use it for data URIs only on tiny assets, under roughly 3 KB. Larger assets lose caching and bloat your CSS.
- In URLs and JWTs you will meet Base64URL, which uses '-' and '_' instead of '+' and '/'. Convert before decoding.
- Strip line breaks from PEM certificates before decoding — they wrap at 64 characters.
- It is encoding, not encryption. Anyone can reverse it instantly.
Common errors and fixes
Invalid character on decode
Whitespace, newlines or URL-encoded characters in the input. Clean the string, or convert from Base64URL first.
The decoded output is another Base64 string
The value was encoded twice somewhere in your pipeline. Decode again, then fix the source.
Accented characters come back as mojibake
The original was encoded without UTF-8 handling. Re-encode the source text with this tool, which handles it correctly.
Padding error
Base64 length must be a multiple of four. Append '=' characters until it is.