Skip to content
GivenTool

Encode or decode Base64

Encode text to Base64 or decode Base64 back to text, UTF-8 safe, with a URL-safe option.

0 / 2,000,000 characters · Updates as you type.

Settings

Decoding accepts both alphabets automatically.

Runs in your browser. Nothing you type is sent anywhere.

Base64 turns any bytes into 64 printable ASCII characters so they survive systems that only handle text: email bodies, JSON fields, HTTP headers, data URLs. Every three bytes become four characters, so the encoded form is about 33% larger than the original.

The classic browser functions btoa and atob only work on Latin-1 characters and throw on anything else. This tool encodes the text as UTF-8 first, so Arabic, Chinese, emoji and accented letters round-trip correctly. The URL-safe variant (RFC 4648 section 5) swaps + and / for - and _ and drops the trailing = padding; it is what JWTs, OAuth state parameters and many APIs use. Decoding accepts either alphabet, with or without padding, and ignores whitespace.

How to use it

  1. Choose the direction: encode text to Base64, or decode Base64 back to text.
  2. Paste your input. The result updates as you type.
  3. For encoding, turn on URL-safe if the value goes into a URL or a JWT.
  4. Copy the output or download it as a text file.

Frequently asked questions

Is Base64 encryption?

No. Anyone can decode it instantly; it hides nothing. Use it only for transport, never to protect secrets.

Why does decoding show strange characters?

The Base64 probably encodes binary data (an image, a compressed file) rather than text, or text in an encoding other than UTF-8. Bytes that are not valid UTF-8 are shown as replacement characters.

Can I decode a data URL?

Paste only the part after the comma (after "base64,"). The prefix "data:image/png;base64," is not Base64 and will be rejected.

What about line breaks every 76 characters?

MIME-style Base64 wraps lines at 76 characters. The decoder ignores all whitespace, so wrapped input works. The encoder produces a single line.