Base64 Encoder and Decoder

Encode UTF-8 text as standard Base64 or Base64url, or decode valid input back to readable text.

Choose standard Base64 or Base64url. Conversion and validation happen locally in your browser.

Choose standard Base64 or Base64url. Conversion and validation happen locally in your browser.

Base64 conversion workspace

Enter text. It will be converted to UTF-8 bytes before encoding.

What this tool does

Convert readable UTF-8 text to standard Base64 or the URL-safe Base64url alphabet.

Decode valid Base64 data to UTF-8 text while checking alphabet, padding and canonical pad bits.

How to use the tool

  1. Choose encode or decode and select standard Base64 or Base64url.
  2. For encoding, decide whether the output should include equals-sign padding.
  3. Enter the matching text or encoded value and run the conversion.
  4. Review the byte and character counts, then copy the result if needed.

Useful applications

  • Prepare text values for APIs, test fixtures, configuration or documentation.
  • Read Base64 or Base64url values found in tokens, URLs or application data.
  • Compare padded and unpadded encodings of the same UTF-8 text.
  • Check whether encoded text is canonical and decodes to valid UTF-8.

Notes and limitations

  • Base64 is an encoding, not encryption, and does not keep the original content secret.
  • Standard Base64 uses + and /; Base64url uses - and _. The alphabets should not be mixed.
  • ASCII spaces and line breaks are ignored while decoding, but other non-alphabet characters are rejected.
  • This tool handles text only. Arbitrary binary files may decode to bytes that are not valid UTF-8.

Frequently asked questions

What is the difference between Base64 and Base64url?

They encode the same bytes, but Base64url replaces + and / with - and _ so the result is safer in URLs and filenames.

Is padding required?

Standard Base64 normally includes = padding. Some protocols allow it to be omitted when the data length is otherwise known.

Why is a seemingly valid string rejected as non-canonical?

Its final unused pad bits are not zero. Another decoder may tolerate it, but it is not the canonical RFC 4648 encoding.

Can this decode files or arbitrary binary data?

No. It validates the decoded bytes as UTF-8 text. Use a binary-aware file tool for arbitrary data.

Is my input uploaded?

No. Encoding, decoding and validation run in your browser.