Base64 Encoder and Decoder

Encode text to Base64 or decode it back, with correct UTF-8 handling for emoji and non-Latin scripts and URL-safe output.

35Input length
56Output length
160%Size change

Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.

What the Base64 Encoder and Decoder does

The base64 encoder and decoder on this page will encode text to Base64 or decode it back, with correct UTF-8 handling for emoji and non-Latin scripts and URL-safe output. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for decoding a Base64 value from a config file or API response. If you want to cross-check the result, there is another base64 encoder and decoder on FreeToolsWorld.org.

How to use it

  1. Paste your text or your Base64 string.
  2. Choose encode or decode.
  3. Turn on the URL-safe option if the result goes into a URL or filename.
  4. Copy the result.

How it works

Base64 represents arbitrary bytes using 64 printable ASCII characters, so binary data can travel through channels that only handle text — email bodies, JSON strings, data URIs, HTTP headers. It costs about 33 per cent in size, which the overhead figure above shows for your input.

The UTF-8 handling matters. JavaScript's built-in btoa only accepts Latin-1 and throws on anything else, which is why so many Base64 tools break on emoji or Cyrillic text. This encodes to UTF-8 bytes first, so any Unicode input round-trips correctly.

The URL-safe variant replaces + and / with - and _, because the standard characters have reserved meanings in URLs and filenames. JWTs use this variant with the padding stripped, which is why the two options are offered together.

Base64 is an encoding, not encryption. Anyone can decode it instantly — as this page demonstrates. It provides no confidentiality whatsoever.

When to use it

  • Decoding a Base64 value from a config file or API response.
  • Encoding a small payload for a data URI or HTTP header.
  • Producing URL-safe Base64 for a token or filename.

Common mistakes to avoid

  • Treating Base64 as a way to hide or protect data — it is trivially reversible.
  • Mixing standard and URL-safe alphabets, which causes decode failures.
  • Forgetting that padding may be required by the receiving system.

Frequently asked questions

Is Base64 encryption?

No. It is a reversible encoding with no key and no secret. Anyone who sees the string can decode it in seconds. Use real encryption if you need confidentiality.

Why does my Base64 fail to decode?

Usually a truncated string, a mixed alphabet (URL-safe characters in a standard decoder), or whitespace and line breaks introduced by copying. This decoder strips whitespace and accepts both alphabets, so those cases work here.

Why is the output larger than the input?

Base64 encodes three bytes as four characters, a 33 per cent increase, plus padding. That is the cost of representing arbitrary bytes in a restricted character set.

Related tools

See all developer tools →