Text with an emoji
- Input
- 👍
- Output
- 8J+RjQ==
Encoders built on btoa alone throw an error here, and the common escape/unescape workaround mangles lone surrogates. Going through UTF-8 bytes gives the correct four-byte encoding.
Base64 represents binary data using 64 printable characters, so it can travel through systems that only accept text — email bodies, JSON fields, data URLs. The usual browser implementation breaks on anything outside Latin-1, which is why an emoji so often comes back as mangled bytes. This encoder goes through UTF-8 properly, so any text round-trips exactly.
Runs entirely in your browser — nothing you paste is uploaded.
How to
Encoding turns text into Base64; decoding turns Base64 back into text. The tool tells you immediately if the input is not valid Base64.
Type, paste from the clipboard, or drop in a file. Conversion happens as you type, with no button to press.
Turn on URL-safe output to replace the plus and slash characters and drop the padding, so the result survives a query string untouched.
Copy the result to the clipboard or save it as a file. Both panes show byte counts, since Base64 always grows the data by roughly a third.
Examples
Encoders built on btoa alone throw an error here, and the common escape/unescape workaround mangles lone surrogates. Going through UTF-8 bytes gives the correct four-byte encoding.
Standard Base64 uses plus and slash, both of which mean something else in a URL. The URL-safe variant swaps them for minus and underscore and drops the padding.
That is the start of a PNG file. Rather than showing replacement characters that look like a successful decode, the tool says plainly that the data is binary.
Why use it
Emoji, accents, Chinese, Arabic and combining marks all encode and decode back to exactly what you started with.
Invalid input names the character that caused it and whether the length is even possible for Base64, instead of failing with a bare exception.
Base64 copied from an email header or a certificate arrives with line breaks. They are stripped automatically rather than rejected.
Encoding runs in the page, so a token or a credential pasted here never reaches a server.
Good to know
Summary
FAQ
Discover