decodes the Base64 data contained in a string and returns the result as a byte array.


  • The result of BaseDecode["string"] is a ByteArray object.
  • BaseDecode uses the default encoding scheme described in the internet standard recommendation RFC 4648.


open allclose all

Basic Examples  (1)

Decode a Base64-encoded string:

Scope  (1)

Encode the bytes 1 through 12:

The bytes can be recovered using BaseDecode:

Properties & Relations  (5)

Characters outside the valid alphabet are automatically dropped:

BaseEncode is the inverse of BaseDecode:

BaseEncode decodes a Base64-encoded string to binary data:

The import format "Base64" decodes a Base64 string and converts the resulting bytes to a string:

Achieve the same result with BaseDecode and ByteArrayToString:

BaseDecode converts the "Base64Encoding" format of Hash to its "ByteArray" format:

ByteArray uses Base64 encoding of its data in InputForm:

Possible Issues  (1)

Inputs must be properly padded to the correct length:

Introduced in 2018