Base64 Encoder and Decoder

Turn text into Base64, or read Base64 back as text — handled entirely inside your browser.

How to encode or decode Base64

  1. Paste your text — or a Base64 string — into the box.
  2. Leave URL-safe unticked for the standard alphabet, or tick it if the result has to travel inside a URL or a filename.
  3. Press Encode to Base64 or Decode to text.
  4. Copy the result, or download it as a text file.

The tool always tells you what it did: encoding reports how many characters went in, and decoding reports when the input is not valid Base64 or does not decode to readable text.

What Base64 is, and when to use it

Base64 is a way of writing arbitrary bytes using only 64 safe characters — the letters A–Z and a–z, the digits 0–9, plus + and /. Every three bytes of input become four characters of output, so the result is about a third larger than the original. That overhead is the entire price of the format, and it buys one thing: the ability to move binary or awkward data through a channel that only accepts text.

That is why email attachments are Base64, why JSON Web Tokens embed Base64-encoded headers and payloads, and why a data URI on a web page looks like data:image/png;base64,iVBORw0…. In every one of those cases the underlying channel cannot carry raw bytes, so the data is encoded into a shape the channel accepts.

The most common misunderstanding is that Base64 hides anything. It does not. There is no key, no password and no transformation that depends on a secret — the output can be decoded by anyone, including this page. If you need to keep something private, encode it and then encrypt it, or send it over a channel that is already protected. Base64 is for compatibility, not for confidentiality.

The URL-safe variant exists because +, / and = all have their own meaning in URLs and filenames, where they can be mangled by a proxy or a query parser. Swapping + for -, / for _ and dropping the padding produces a string that survives a round trip through a link untouched.

Base64 FAQ

Is Base64 encryption?

No. Base64 is an encoding, not encryption. There is no key and no secrecy — anyone can decode it in a second. Use it to carry data through text-only channels, never to protect a password or a secret.

Does Base64 make my data bigger?

Yes, by about a third. Every three bytes of input become four characters of output, and the padding equals signs add a little more.

What is URL-safe Base64?

Standard Base64 uses + and /, which have their own meaning inside a URL. The URL-safe variant swaps them for - and _ and drops the trailing padding, so the string can be pasted straight into a link or a filename.

Why does decoding fail?

Either the string contains characters that are not part of the Base64 alphabet, or the decoded bytes are not UTF-8 text. A Base64-encoded image, for example, decodes to binary data and cannot be shown as text.

Related tools