Base64 Encoder and Decoder with UTF-8 Support
Encode plain text to Base64 or decode Base64 back to text
What is Base64?
Base64 is an encoding scheme that represents binary data as printable ASCII characters. It increases size by ~33% and is commonly used in emails, data URIs, and HTTP Basic Auth.
Common uses
- Encoding images in CSS / HTML data URIs
- HTTP Basic Authentication headers
- JWT token payloads
- Email attachments (MIME)
What is Base64 encoding?
Base64 maps arbitrary bytes onto 64 printable ASCII characters (A–Z, a–z, 0–9, + and /) so binary or non-ASCII data can travel safely through systems that only handle plain text — email bodies, JSON strings, HTTP headers, URLs. It is an encoding, not encryption: anyone can reverse it, and it adds roughly 33% to the size. This tool converts in both directions, handles full UTF-8 (emoji, accented characters, CJK text) correctly, and updates the output as you type.
Everything runs in your browser. The text you paste is never uploaded, stored, or logged, so it's safe to decode tokens or payloads that contain credentials or internal data.
When to use it
The most common day-to-day use is decoding: you're staring at a JWT segment, an HTTP Basic Auth header, a Kubernetes Secret value, or a data: URI and want to see what's inside. Paste it in decode mode and read the plain text. Encoding comes up when you need to build one of those same artifacts by hand — an Authorization: Basic header from user:password, a small image or file embedded as a data URI, or a config value that must survive a text-only channel.
The Swap button feeds the current output back in as input and flips the direction, which is handy for verifying a round trip. If you need to share what you're looking at, the "Copy link to this result" button encodes your input and mode into the URL fragment, so a teammate opens the exact same conversion.
Example
Switch to Text → Base64 and type admin:s3cret — the output panel shows YWRtaW46czNjcmV0, which is exactly what goes after "Basic " in an Authorization header. Now hit Swap: the tool flips to decode mode, feeds the Base64 back in, and returns admin:s3cret, proving the round trip. The character counters under each panel show the ~33% size overhead in real time.
How to use the Base64 Encoder and Decoder with UTF-8 Support tool
- 1
Pick a direction
Choose Text → Base64 to encode or Base64 → Text to decode.
- 2
Paste your input
The output appears instantly as you type — no button to press.
- 3
Swap to verify
The Swap button feeds the output back in with the direction reversed, confirming a clean round trip.
- 4
Copy or share
Copy either panel, or copy a permalink that restores your input and mode for anyone who opens it.
Frequently asked questions
Is Base64 encryption?
No. Base64 is a reversible text encoding with no key and no secrecy — anyone can decode it instantly. Never treat a Base64 string as protected; if you need confidentiality, encrypt first and Base64-encode the ciphertext.
Why does decoding fail with an 'invalid character' error?
The input contains characters outside the Base64 alphabet, has been truncated, or uses the URL-safe variant (- and _ instead of + and /). Whitespace is stripped automatically, but you'll need to swap - back to + and _ back to / for URL-safe strings, and restore any stripped = padding.
Does this handle emoji and non-English text?
Yes. The encoder converts text to UTF-8 bytes before encoding, and the decoder reverses it, so emoji, accented characters and CJK scripts round-trip correctly — unlike a naive btoa() call, which throws on anything outside Latin-1.
Is my data sent to a server?
No. Encoding and decoding run entirely in your browser with JavaScript. Even the shareable permalink keeps your input in the URL fragment, which browsers never send to the server.
Related on TechLogHub
Related Encoding Tools
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

