Base64 Encoder / Decoder

Encode plain text to Base64 and decode Base64 back into readable text directly in your browser.

Input

0 characters

Output

0 characters

Common use cases for Base64

  • Embedding small images directly in CSS or HTML using data URIs.
  • Encoding email attachments in MIME messages (SMTP is text-based).
  • Storing binary data like tokens or credentials inside JSON payloads.
  • Passing data safely inside URLs where certain characters aren't allowed.

Related Tools

About the Base64 Encoder / Decoder

Base64 is an encoding that represents binary data using only 64 safe ASCII characters — letters, digits, plus, slash, and equals for padding. It exists because many protocols (email was the first) mangle raw binary; encoding to Base64 wraps arbitrary bytes in characters every system passes through untouched. The trade-off is size: encoded output is roughly 4/3 the length of the input.

This tool encodes text to Base64 and decodes it back, handling Unicode correctly through the standard UTF-8 chunking technique — so emoji, Devanagari, and CJK characters survive the round trip exactly, which naive implementations break.

Common confusion worth clearing up immediately: Base64 is encoding, not encryption. Anyone can decode it; it provides transport safety, never secrecy.

How to use the Base64 Encoder / Decoder

  1. 1 Paste your text into the input area.
  2. 2 Choose Encode (text to Base64) or Decode (Base64 back to text) — output appears instantly.
  3. 3 Copy the result with one click, or clear both fields to start over.
  4. 4 For decoding, malformed input is reported clearly rather than producing garbage.

Key features

UTF-8 safe round trips

Chunked encoding preserves emoji and multi-byte scripts byte-for-byte.

Bidirectional

Encode and decode in the same interface with instant output.

Error transparency

Invalid Base64 is caught with a clear message, not silent corruption.

Fully local

Encoding happens in your browser; sensitive strings never leave the page.

Who uses the Base64 Encoder / Decoder?

  • Embedding small images or fonts directly in HTML/CSS via data: URIs.
  • Decoding JWT token segments to inspect claims during development.
  • Preparing email attachments and MIME multipart content.
  • Passing binary-safe values through URLs, cookies, and JSON fields.
  • Debugging API payloads that transport Base64-wrapped blobs.

Tips and best practices

  • For URLs and filenames, use the URL-safe variant: − and _ replace + and /, and padding is often dropped.
  • Padding (=) is computable from length, so some systems strip it; decoders here tolerate both styles on well-formed input.
  • Base64 inflates data by ~33%; for large files prefer real binary transport (multipart POST, S3 multipart).
  • A string whose length is not divisible by 4 after stripping whitespace is invalid Base64 — a fast sanity check.
  • Never store secrets "encoded" as Base64; decoders are one click away for everyone.

Frequently asked questions

No. It is a reversible encoding with no key. Anyone can decode Base64 instantly; use real cryptography for confidentiality.

Padding aligns the final group to four characters. One = means two bytes in the last group, two = means one byte; it is recomputable and sometimes omitted.

Naive implementations treat text as Latin-1 bytes. Correct UTF-8 chunked encoding (used here) preserves every multi-byte character exactly.

Exactly 4/3 before padding — every 3 bytes become 4 characters, plus up to two padding characters per block.

Only strings whose characters and length fit Base64’s alphabet decode; anything else is reported as malformed rather than guessed at.