Text & dev

Base64 Encoder & Decoder

Convert text to Base64 and back without losing a single character. Choose Encode to turn any text — including emoji, accented letters and other non-ASCII characters — into a safe Base64 string, or Decode to turn a Base64 string back into readable text. Base64 is the standard way to carry arbitrary data through systems that only handle plain text: data URLs, JSON Web Tokens, email attachments, basic authentication headers and config files all rely on it. This converter is fully UTF-8 safe, so a string containing "café 🚀" round-trips perfectly instead of turning into garbled bytes. Everything runs in your browser using the native encoding APIs, so your text is never uploaded and you can safely encode tokens, credentials or private notes.

Your text

Mode
Base64 output RABIXAI
Your result will appear here.
Input length0
Output length0
Copied ✓

UTF-8 safe: encoding uses TextEncoder + btoa; decoding uses atob + TextDecoder.

How the Base64 converter works

Plain btoa only accepts characters in the Latin-1 range, so it breaks on emoji and accented letters. This tool avoids that by first turning your text into raw UTF-8 bytes with TextEncoder, then Base64-encoding those bytes. Decoding reverses the steps: atob recovers the bytes and TextDecoder rebuilds the original Unicode text. That two-step approach is what makes the round-trip lossless for any character.

The pipeline

Encode: text → TextEncoder → bytes → btoa → Base64 Decode: Base64 → atob → bytes → TextDecoder → text

Base64 encodes 3 bytes into 4 characters, so encoded output is about 33% larger than the input.

Notes & assumptions

Frequently asked questions

What is Base64 actually used for?

Base64 lets you carry binary or non-ASCII data through channels that only support plain text. Common uses include embedding small images directly in HTML or CSS as data URLs, encoding the payload of a JSON Web Token (JWT), attaching files in email via MIME, and building HTTP Basic authentication headers. It is an encoding, not encryption — anyone can decode it — so it makes data transport-safe, not secret.

Why does my Base64 tool break on emoji or accented letters?

Browsers' built-in btoa function only accepts characters up to code point 255, so feeding it an emoji or a character like "é" throws an error. This tool fixes that by converting your text to UTF-8 bytes with TextEncoder before encoding, and reversing the process on decode. That is why "café 🚀" encodes and decodes here without corruption.

Is Base64 the same as encryption?

No. Base64 is a reversible encoding that anyone can decode instantly — it provides no secrecy or protection at all. Never use it to hide passwords, API keys or personal data from anyone who can read the encoded string. If you need confidentiality, use real encryption. Base64 is only about making data safe to transmit through text-only systems.

Why is my encoded string longer than the original?

Base64 represents every 3 bytes of input using 4 printable characters, which makes the output roughly 33% larger than the input, plus a little padding. That overhead is the price of being able to move arbitrary data through text-only channels. Decoding restores the exact original size and content, so nothing is permanently added.

Is my text uploaded anywhere?

No. Encoding and decoding both run entirely in your browser using native JavaScript APIs. Your input is never sent to a server, stored or logged, so you can safely encode tokens, credentials, configuration snippets or private notes. Close the tab and nothing is retained on your device or anywhere else.