Skip to content
TabBench

Base64 Encoder & Decoder

Encode text or files to Base64 or data: URIs, and decode Base64 back to text, images or downloadable files, with URL-safe and MIME options.

Runs in your browser. Nothing you add is uploaded.

What the Base64 Encoder & Decoder does

Base64 encodes arbitrary bytes using 64 printable ASCII characters, which lets binary data survive channels that only accept text — email bodies, JSON fields, data URIs, HTTP headers. It is an encoding, not encryption: anyone can decode it instantly, and it offers no confidentiality whatsoever. This converter encodes text or any file, as plain Base64 or a ready-to-use data: URI, and decodes Base64 back to text, an image preview or a file you can download. It all runs in your browser, so credentials and files you decode for debugging never touch a server.

How to encode and decode Base64

  1. Choose Encode to Base64 or Decode Base64.
  2. To encode, type text or switch to File and drop in an image, font or PDF. For files, keep “As a data: URI” on to paste it straight into src= or url().
  3. Turn on URL-safe for values that go in URLs or file names, or line breaks for email (MIME).
  4. To decode, paste Base64 or a data: URI. Text is shown directly; images get a preview, and any file can be downloaded.
  5. If decoding fails, the message points to the character or length problem, such as a missing character at the end of a copied value.

The Base64 Encoder & Decoder runs entirely in your browser — nothing you enter is uploaded, stored, or logged.

When to use it

Inspecting Basic Auth headers

An 'Authorization: Basic' header is just base64 of 'username:password'. Decoding it while debugging shows immediately whether the client is sending the credentials you expect.

Building data URIs

Small images and fonts can be embedded directly in CSS or HTML as base64 data URIs, removing a network round trip at the cost of about 33% more bytes.

Moving binary through JSON

JSON has no binary type, so file contents are conventionally base64-encoded into a string field before transport and decoded on receipt.

Good to know

  • Base64 inflates data by roughly 33%. Three bytes of input become four characters of output.
  • A string whose length is not a multiple of four is either truncated or missing its '=' padding.
  • URL-safe Base64 (RFC 4648 §5) swaps '+' for '-' and '/' for '_' so the result survives being placed in a URL. JWTs use this variant.
  • Never treat Base64 as a security measure — it is trivially reversible by design.

Frequently asked questions

What is Base64 used for?

Base64 encodes binary data into ASCII characters for safe transmission in JSON, email, and URLs.

Is Base64 encryption?

No, and this distinction matters. Base64 is a reversible encoding with no key and no secret. Anyone who sees the encoded string can recover the original in one step. Encoding a password in Base64 provides exactly zero protection.

Why does my Base64 string end in one or two equals signs?

Base64 processes input in three-byte groups that map to four output characters. When the input length is not divisible by three, '=' characters pad the final group. One '=' means the input had two bytes left over; two '=' means one byte.

Why does decoding produce garbled characters?

Usually because the original bytes were not UTF-8 text — decoding a PNG to a text field will always look like noise. It can also mean the string is URL-safe Base64 that needs its '-' and '_' characters translated first.

Can I encode files as well as text?

This converter handles text input. For files, the same principle applies — the browser reads the bytes and emits the Base64 string — but note that the result is about a third larger than the file, so very large files produce unwieldy output.

Does Base64 handle emoji and non-English text?

Yes. Text is converted to UTF-8 bytes before encoding, so any Unicode character round-trips correctly, including emoji, accented Latin, Devanagari, and CJK scripts.