Base64 Encode Decode
Paste text to encode it to Base64 or paste a Base64 string to decode it back to plain text. Both directions live on one page and the result appears instantly as you type, with full Unicode (UTF-8) support so emoji and non-English characters survive intact. Everything runs in your browser — nothing you type is ever uploaded.
What is the Base64 Encode Decode tool?
This is a free, browser-based Base64 encode decode tool. Paste any text and it converts it into a Base64 string, or paste a Base64 string and it decodes it straight back to readable text. Both directions live on a single page, so you never have to switch tools or modes. It is built to handle real-world text correctly — including emoji and non-English characters — and it runs entirely in your browser, so nothing you type is ever uploaded.
How to use it
- Pick a direction: Encode (text to Base64) or Decode (Base64 to text).
- For encoding, choose Standard or URL-safe output, then decide whether to keep padding or wrap long lines.
- Paste or type your input into the box.
- The result appears instantly as you type — no button-mashing required.
- Click Copy to grab the output, then close the tab. Answer in, answer out, done.
If you paste an invalid Base64 string into the decode box, the tool tells you instead of returning silent garbage, so you always know whether the input was well-formed.
The method behind it
Base64 represents data using 64 printable ASCII characters: A–Z, a–z, 0–9, plus
+ and /. The encoder reads the input as bytes, then walks
through it 3 bytes (24 bits) at a time and re-slices those 24 bits into four 6-bit
groups. Each 6-bit group (a value from 0 to 63) maps to one Base64 character, so every
3 input bytes become 4 output characters — roughly a 33% size increase. When the input
length is not a multiple of 3, the final group is padded with one or two =
characters so the output stays a clean multiple of four. Decoding simply reverses the
process.
URL-safe Base64, also called Base64URL, swaps + for - and
/ for _, and often removes trailing = padding.
That variant is common in JWT segments, URL parameters, and short identifiers. This
tool can emit either alphabet and the decoder reports whether pasted input looked
standard, URL-safe, padded, padless, or wrapped across multiple lines.
The important detail is character handling. Doing Base64 in a browser naively with
btoa() only accepts characters in the Latin1 range and throws an error on
anything else — including emoji and most non-English scripts. This tool first encodes
your text as UTF-8 bytes, then applies Base64 to those bytes, so every character
round-trips losslessly. Decoding reverses both steps: Base64 back to bytes, then UTF-8
bytes back to text.
Examples
- Encode:
Hello, World!→SGVsbG8sIFdvcmxkIQ== - Decode:
dXRpbGl0aWVzdG9vbHM=→utilitiestools - URL-safe decode:
8J-YgA→😀(missing padding is restored safely) - Unicode round-trip:
Café ☕→Q2Fmw6kg4piV→ back toCafé ☕(note how the accentedéand the emoji survive intact)
Common use cases
- Data URIs: embed a small image, font, or SVG directly inside HTML or CSS as
data:...;base64,...to avoid an extra network request. - HTTP and API work: read or build
Authorization: Basic ...headers, or inspect a Base64-encoded token or payload while debugging. - Email and MIME: understand how attachments are encoded for transport over text-only mail systems.
- Config and JSON/XML: carry binary fields (keys, certificates, blobs) inside text-only formats that cannot hold raw bytes.
- Quick debugging: decode a mysterious Base64 blob from a log, cookie, or URL parameter to see what it actually contains.
Why use this one
Three things set it apart from the typical online encoder. First, it is
bidirectional on one page — encode and decode without hunting for a
second tool. Second, it is Unicode-correct: emoji and non-Latin text
encode and decode without the btoa() crash that breaks many competitors.
Third, it handles Base64URL and padding edge cases directly in the
work surface, so JWT and URL payload debugging is clearer. Finally, it is
private by design — every conversion happens in your
browser, so sensitive strings never touch a server. No sign-up, no paywall, instant
results, one-click copy.
For related developer workflows, pair it with the URL Encode / Decode tool for percent-encoding, the JSON Formatter for cleaning up API payloads, and the Regex Tester for pattern matching.
Frequently asked questions
What is Base64 encoding used for?
Base64 turns binary or text data into a safe set of 64 ASCII characters so it can travel through channels built for text — embedding images in HTML/CSS as data URIs, putting credentials in HTTP headers, sending attachments in email (MIME), or carrying binary fields inside JSON and XML.
Is Base64 encoding the same as encryption?
No. Base64 is reversible encoding, not encryption. Anyone can decode a Base64 string back to the original with no key, so never use it to hide passwords or secrets — use it only to make data transport-safe.
Does this tool support emoji and non-English text?
Yes. It encodes text as UTF-8 before converting to Base64, so emoji, accented characters, Chinese, Arabic, and other scripts round-trip correctly. Many simple tools that call btoa() directly break on these — this one does not.
Is my data uploaded to a server?
No. All encoding and decoding runs entirely in your browser using JavaScript. Your text is never sent over the network, stored, or logged — safe even for sensitive strings.
Why do I sometimes see '=' signs at the end of a Base64 string?
Those are padding. Base64 works in 3-byte groups; when the input length is not a multiple of 3, one or two '=' characters pad the final group so the output stays a multiple of 4 characters. The decoder uses them to reconstruct the exact original bytes.
What is URL-safe Base64?
URL-safe Base64, or Base64URL, swaps '+' for '-' and '/' for '_' so the encoded value can sit inside URLs, JWT segments, and identifiers without percent-encoding. Padding '=' signs are often optional or removed in those workflows.