Developer & Data100% Free for AllClient-Side PrivateAuto-saved (3 days)

Base64 Encoder / Decoder

Convert plain text to Base64 and decode Base64 strings to readable UTF-8 text with instant one-click copy and error detection.

Plain Text (Input)
Base64 Output

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 runs both directions in your browser, so credentials and tokens you decode for debugging never touch a server.

How to encode and decode Base64

  1. Choose a direction — Encode turns plain text into Base64, Decode turns Base64 back into text.
  2. Paste your input. Leading and trailing whitespace is ignored.
  3. Read the result and copy it. Conversion happens as you type.
  4. If decoding fails, check for missing '=' padding at the end or for URL-safe characters ('-' and '_') that need converting back to '+' and '/'.

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

When to use this tool

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.

Things worth knowing

  • 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.