Encoder

Base64 Encode / Decode

Convert text to Base64 and back, with correct UTF-8 handling. You can also encode a file into a data URL.

How to use it

  1. Choose Encode or Decode.
  2. Type or paste your text. The result updates instantly.
  3. To encode an image or other file, press Encode a file…. The result is a data: URL you can use in HTML or CSS.
  4. If decoded data isn’t text, it is shown as hex and you can download it as a file.

What Base64 is

Base64 represents binary data using 64 safe characters: A–Z, a–z, 0–9, + and /, with = as padding. Every 3 bytes become 4 characters, so the encoded text is about 33% larger. It is used to put binary data where only text is allowed: email attachments, data URLs, JSON fields, HTTP Basic authentication and JWTs.

Base64 is not encryption. Anyone can decode it, so never use it to protect passwords or secrets.

URL-safe Base64

Standard Base64 uses + and /, which have special meaning in URLs. The URL-safe variant (Base64URL, RFC 4648) uses - and _ instead and usually drops the = padding. JWTs use Base64URL. When decoding, this tool accepts both variants and missing padding.

Unicode and emoji

The browser’s built-in btoa() fails on characters outside Latin-1, such as 世界 or 👋. This tool first converts text to UTF-8 bytes, so any language and emoji encode correctly and decode back to the same text.

Frequently asked questions

Is Base64 secure?

No. It is an encoding, not encryption. Anyone can decode it instantly.

Why does my Base64 end with = or ==?

Padding. Base64 works in groups of 4 characters, and = fills the last group when the input length isn’t a multiple of 3 bytes.

Why is the output bigger than the input?

Every 3 bytes become 4 characters, so Base64 is about a third larger than the original data.

Can I decode an image?

Yes. Paste the Base64 or data URL. Because it isn’t text, the tool shows hex and lets you download the decoded file.

Is my data uploaded?

No. Everything runs with JavaScript inside your browser tab. Nothing you paste is sent to a server or stored.