Mode

Result

Enter text to encode or Base64 to decode.

How to use this tool

  • Choose Encode or Decode and paste your input.
  • To encode a file (up to 5 MB), choose it with the file picker; it is read locally.
  • Tick URL-safe to use - and _ instead of + and / without = padding, as in JWTs and URLs.
  • Decoding accepts standard or URL-safe Base64, with or without padding or a data: prefix.

How it works

Text is first converted to UTF-8 bytes. Every 3 bytes (24 bits) become 4 Base64 characters of 6 bits each, using A–Z, a–z, 0–9, + and /. When the input length is not a multiple of 3, = padding is added. Decoding reverses this; if the bytes are not valid UTF-8 text, the first bytes are shown as hexadecimal instead.

Example

Encoding

“Hello, world!” → SGVsbG8sIHdvcmxkIQ==

Non-English text

“héllo ✓” is encoded as UTF-8 → aMOpbGxvIOKckw==

Privacy and limitations

  • Everything happens in your browser; text and files are never uploaded.
  • Base64 is an encoding, not encryption — anyone can decode it. Never use it to hide secrets.
  • Base64 makes data about 33% larger.

Frequently asked questions

What is Base64 used for?

Sending binary data through systems designed for text: email attachments, data URIs in HTML and CSS, JSON payloads and HTTP basic authentication headers.

What is URL-safe Base64?

A variant that replaces + with - and / with _ and usually drops = padding, so the result can be used in URLs and filenames without escaping.