Base64 Encode / Decode

Paste text or Base64 and get the other form instantly. Handles Unicode, emoji and accented characters correctly.

Embed this tool

Paste this into your page — the widget loads noindexed and links back here.

How Base64 works

Binary data is a stream of bytes (0–255). Base64 takes those bytes three at a time — 24 bits — and splits them into four 6-bit groups, each of which maps to one of 64 characters. When the input length is not a multiple of three, one or two = characters pad the end. Decoding reverses the process to recover the exact original bytes.

Where you will see it

  • Data URLs — small images embedded directly in CSS or HTML as data:image/png;base64,…
  • JWTs — each of the three dot-separated parts is URL-safe Base64 (see the JSON guide)
  • Email attachments — MIME encodes binary parts as Base64
  • HTTP Basic auth — the user:passwordstring is Base64-encoded (and, again, not encrypted)
  • Config and secrets files — Kubernetes secrets store values Base64-encoded (encoding, not protection)

Not a security measure

Base64 is trivially reversible. Anything that must stay private needs real encryption. If you are generating secrets, use the password generator or the UUID generator, both of which draw on the browser's cryptographic random source.

Related tools

Frequently asked questions

What is Base64?
A way of representing binary data using only 64 printable ASCII characters (A–Z, a–z, 0–9, + and /), with = as padding. It makes arbitrary bytes safe to put in text-only places like email bodies, JSON, XML, HTML data URLs and HTTP headers.
Why is the Base64 output longer than my text?
Base64 encodes every 3 bytes of input as 4 characters of output, so the result is about 33% larger. That is the cost of making binary data text-safe.
Does it handle emoji and accented letters?
Yes. The text is first encoded as UTF-8 bytes, then those bytes are Base64-encoded, so 'café' and '🚀' round-trip exactly. A naive browser btoa() call would throw on those characters — this tool does the UTF-8 step for you.
Is Base64 encryption?
No. It is encoding, not encryption — anyone can decode it with no key. Never use Base64 to hide passwords, tokens or personal data. It only changes the representation of the bytes, not their secrecy.
What is URL-safe Base64?
A variant that replaces + with - and / with _ (and often drops the = padding) so the string can be used in URLs and filenames without further escaping. JWTs use it. This tool produces standard Base64; convert + → - and / → _ if you need the URL-safe form.
Can I decode a data URL?
A data URL looks like data:image/png;base64,iVBORw0KGgo… — paste just the part after the comma to decode it. The result will be raw bytes, which only display as readable text if the original content was text.
Why do I get an error decoding?
The input is not valid Base64 — usually because of a stray space or newline, a missing = pad, or characters outside the Base64 alphabet. Trim whitespace and check you copied the whole string.

Last reviewed: September 2026. Figures and formulas are checked against their published sources; see the site's data notes.