Base64 Encoder/Decoder

Encode text or files to Base64 format or decode Base64 strings back to their original form.

Base64 Encoder / Decoder

What is Base64?

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format. It's commonly used when there is a need to encode binary data that needs to be stored and transferred over media that are designed to deal with text.

Common Uses of Base64

  • Embedding images directly in HTML or CSS using data URIs
  • Encoding email attachments (MIME)
  • Storing complex data in JSON
  • Transmitting binary data over text-only protocols
  • Encoding binary data in URLs

Example

Plain Text

Hello, World!

Base64 Encoded

SGVsbG8sIFdvcmxkIQ==

URL-Safe Base64

URL-safe Base64 is a variant of Base64 encoding that can be safely used in URLs and filenames. It replaces the '+' and '/' characters with '-' and '_' respectively, and removes the padding '=' characters.

Base64 vs. URL Encoding

While both Base64 and URL encoding are used to represent data in a text format, they serve different purposes:

  • Base64 encodes binary data into ASCII characters
  • URL encoding ensures special characters are properly represented in URLs
  • Base64 is often used for binary data like images and files
  • URL encoding is specifically designed for query parameters and form data in URLs