Base64 Encoding and Decoding

Easily encode and decode data to and from Base64 format with our online tool. Convert text, images, or files to Base64 for secure data transmission or storage. Decode Base64 strings back to their original format.

Select the type :

or drop your file here

The result of Base64 encoding will appear here

Base64 is a binary-to-text encoding scheme that converts binary data into a format that is safe for transmission over text-based protocols, such as email or HTTP. It achieves this by representing binary data using a set of 64 printable ASCII characters.

01. How to Encode Base64

  • The input data is divided into groups of three bytes (24 bits) each.
  • Each group is then split into four 6-bit chunks.
  • The decimal value of each 6-bit chunk is used as an index into a lookup table that contains the 64 characters used in Base64 encoding.
  • The corresponding character for each index is taken and concatenated together, resulting in a string of Base64-encoded characters.
  • If the input data is not evenly divisible by three, padding characters ('=') are added to the end to make the total length a multiple of four.

02. How to Decode Base64

  • The Base64-encoded string is divided into groups of four characters.
  • Each character is converted back to its 6-bit binary representation using the lookup table.
  • The resulting four 6-bit chunks are combined to form three bytes (24 bits).
  • If padding characters ('=') are present, they are ignored during the decoding process.
  • The final result is the decoded binary data.