URL Encoder/Decoder

Encode and decode Base64 strings with support for standard and URL-safe formats.

Cleared

URL-Safe Base64
URL-Safe Base64 Toggle Toggle ON to enable URL-safe Base64 encoding/decoding, which can be used in URLs and filenames.

When URL-safe mode is enabled:
  • During encoding, + and / become - & _.
  • During decoding, - & _ become + and /.

Copied

Base64 Encoding/Decoding

What is Base64 Encoding?

Base64 encoding converts binary data into a text string using a specific 64 character set.

  • A-Z (26 characters)
  • a-z (26 characters)
  • 0-9 (10 characters)
  • + and / (2 characters)

In addition to the 64 characters, the = character is used at the end to make the Base64 string a multiple of 4. This is necessary for accurate decoding.

For example, when the string convertchief.com is encoded in Base64, it becomes Y29udmVydGNoaWVmLmNvbQ==.

Where is Base64 encoding used?

Base64 is used for

  • embedding images in CSS/HTML (data URLs)
  • encoding email attachments
  • storing binary data in JSON/XML
  • transmitting binary files over text-only channels
  • and so on

What's the use of = in Base64 encoding?

A Base64 string must have a length that is a multiple of 4 characters (each group of 3 bytes, or 24 bits, is encoded as 4 Base64 characters).

If a Base64 string's length is not a multiple of 4, = characters are added at the end for padding.

Can any text string be decoded using Base64?

No, not all text strings can be decoded using Base64. It's because a valid Base64 encoded data can't contain characters other than A–Z, a–z, 0–9, +, /, and possibly = for padding.

If you try to decode a string that contains characters other than the above, our Base64 decoder tool will show you an error message.

What is URL-safe Base64 encoding?

URL-safe Base64 format is a variant of Base64 encoding that replaces + with - and / with _ so that it can be safely used in URLs and filenames.

Base64 Encoding Examples

Original: Convert Chief

Encoded: Q29udmVydCBDaGllZg==

Original: Hello World?

Encoded: SGVsbG8gV29ybGQ/

Original: Hello World?

Encoded (URL-safe): SGVsbG8gV29ybGQ_