Live
No signup

Base64 Encoder / Decoder

Bidirectional Base64.

Encode to Base64

28 chars

Wm9uYSBVdGlsaXR5IPCfmoAgaG9sYSwgd29ybGQh

40 chars

How this tool works

Base64 turns binary data or UTF-8 text into a 64-character ASCII string safe to transmit over text-only channels: email, URLs, JSON, HTTP headers. It is not encryption — it's reversible encoding.

This converter handles three variants: standard (with +, /, =), URL-safe (with -, _, no padding) used in JWT and OAuth tokens, and data URIs (data:image/png;base64,...) for inline images.

How to use it, step by step

  1. 1

    Paste or type

    Plain text to encode; Base64 string to decode. We auto-detect.

  2. 2

    Pick a variant

    Standard for general use; URL-safe for JWT and query strings; no padding when the protocol requires.

  3. 3

    Copy result

    Copy button. If you pasted a JWT, we split header.payload.signature decoded for you.

Common pitfalls

  • Base64 is NOT encryption — anyone can decode it. Don't use for secrets.
  • Non-ASCII chars inflate ~33%. A 1MB PDF becomes ~1.33MB in Base64.
  • Padding (=) is optional in some implementations, required in others. If your decoder fails, try adding or removing it.

Frequently asked questions

Is Base64 safe for storing passwords?
No. It's encoding, not encryption. Anyone with the string can recover the original. For passwords use bcrypt, argon2 or scrypt.
Why doesn't my JWT work with standard Base64?
JWT uses Base64URL (no +, /, no padding). Toggle URL-safe mode on the decoder.
Can I upload a binary file?
Yes. We convert with FileReader.readAsDataURL — handy for embedding images in CSS or HTML.
How much does Base64 grow a file?
Exactly 33% (4 Base64 chars = 3 binary bytes), plus a few padding bytes.