Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 to UTF-8 text with URL-safe alphabet support, optional padding, byte counts, copy, and swap.

Encode and decode UTF-8 text

Base64 is a transport encoding, not encryption. It is useful when text or bytes need to travel through systems that expect plain ASCII: headers, data URLs, tokens, fixtures, small config values, or examples in documentation. This tool converts UTF-8 text to Base64 and decodes valid Base64 back to text in the browser.

The URL-safe option switches the alphabet from plus and slash to dash and underscore, which is common in web tokens. Padding can be omitted for systems that prefer compact Base64URL values.

Loading tool...

Common Base64 checks

  • Encode short JSON snippets or strings before placing them into transport fields.
  • Decode copied Base64 values to confirm what a token-like field actually contains.
  • Switch to URL-safe Base64 for values that appear inside URL paths, query parameters, or JWT-style structures.
  • Use byte and character counts to catch unexpected Unicode, whitespace, or padding changes.
  • Swap output back into input when you want to round-trip a value.

What Base64 does not do

Base64 does not make data secret. Anyone can decode it. Do not use it as a substitute for hashing, encryption, signing, or access control. It only changes representation so data is easier to carry through text-only systems.

Base64 FAQ

Does this handle Unicode text?

Yes. Text is encoded and decoded as UTF-8, so non-ASCII characters are handled as text instead of broken byte strings.

What is URL-safe Base64?

URL-safe Base64 replaces plus with dash and slash with underscore. Padding is often omitted in the same contexts.

Why does decoding fail?

The input may contain invalid Base64 characters, impossible length, or bytes that are not valid UTF-8 text.