About the Base64 Encoder
This encoder converts plain text into Base64, the ASCII-safe encoding used for embedding binary-ish data in JSON, URLs, email and config files. It correctly handles Unicode text by encoding to UTF-8 bytes first, so emoji and non-Latin scripts round-trip without corruption.
How to use it
- 01Type or paste the text you want to encode.
- 02Optionally switch on the URL-safe alphabet if the result will live in a URL or filename.
- 03Optionally wrap the output at 76 characters, matching classic MIME line lengths.
- 04Copy the encoded Base64 string.
Features
- Unicode-safe: encodes via UTF-8 bytes rather than raw character codes
- URL-safe variant (-, _ instead of +, /, no padding)
- Optional 76-character line wrapping
- One-click copy of the result
Practical examples
API payloads
Embed binary-looking data safely inside JSON string fields.
Basic auth headers
Encode a username:password pair for an Authorization header.
Limitations
- This tool encodes text input, not arbitrary binary files.
- Very long inputs are processed in memory in your browser tab.
Privacy
All encoding happens locally in your browser. Nothing you type is uploaded or stored.
Read the full privacy policy for how the site as a whole handles data.
Frequently asked questions
Why does encoding emoji work here but not in some other tools?
Text is first converted to UTF-8 bytes with TextEncoder before Base64 encoding, avoiding the classic btoa() Unicode error.
What is the URL-safe variant for?
It replaces + and / with - and _ and drops padding, so the result can be used directly in URLs or filenames.
Is Base64 encryption?
No. Base64 is a reversible encoding, not encryption — anyone can decode it instantly.