Base64 Encode/Decode

Encode text to Base64 or decode Base64 strings instantly. Auto-converts as you type with character count display.

About Base64 Encode/Decode

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It is commonly used to encode data that needs to be transmitted over text-based protocols like email or HTTP.

How Base64 Works

  • Encoding: Every 3 bytes of input data are converted into 4 Base64 characters
  • Character Set: Uses A-Z, a-z, 0-9, + and / (with = for padding)
  • Size Increase: Base64 encoding increases data size by approximately 33%
  • Reversible: Base64 is an encoding (not encryption) and can be easily decoded

Common Uses

  • Embedding images in HTML or CSS (data URIs)
  • Encoding email attachments (MIME)
  • Transmitting binary data in JSON or XML
  • Encoding authentication credentials (HTTP Basic Auth)
  • Storing binary data in text-based configuration files

Base64 Examples

  • Text: "Hello" → Base64: SGVsbG8=
  • Text: "Base64" → Base64: QmFzZTY0
  • Text: "abc123" → Base64: YWJjMTIz

Notice the = padding at the end of "SGVsbG8=" — this appears when the input length is not a multiple of 3 bytes.

Frequently Asked Questions

  • No. Base64 is an encoding scheme, not encryption. It is designed for data transport, not security. Anyone can decode Base64 text. Never use Base64 to protect sensitive information — use proper encryption instead.
  • Base64 encoding increases data size by approximately 33%. Every 3 bytes of input produce 4 bytes of Base64 output. This overhead is the trade-off for being able to represent binary data as ASCII text.
  • The = character is padding. Base64 works in groups of 3 input bytes (producing 4 output characters). If the input is not a multiple of 3 bytes, padding is added: one = if 1 byte short, two == if 2 bytes short.
  • This tool is designed for text-to-Base64 encoding. For encoding images or binary files, you would need a file-to-Base64 converter that reads the raw binary data.
  • Yes. All encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server. Your text never leaves your computer.