Base64
Encoding
By Ganesh Bagaria
What is Base64?
Base64 encoding is a process of converting binary data to an ASCII
string format.
When to use Base64?
The need for Base64 encoding comes from the problems that occur
when media (Image,Video) is transmitted in raw binary format to text-
based systems. Since text-based systems (like email) interpret binary
data as a wide range of characters, including special command
characters, much of the binary data that is transmitted to these
systems is misinterpreted and lost or corrupted in the transmission
process.
In other words, these encodings are necessary for transmission of
data when the channel (like Email) does not allow binary data.
Base64 Encoding
Let’s understand Base64 encoding through an example
ASCII Text Hello World!
Bit representation of text 01001000 01100101 01101100 01101100
01101111 00100000 01010111 01101111
01110010 01101100 01100100 00100001
Bit representation of text
in groups of 6 bits
010010 000110 010101 101100 011011 000110
111100 100000 010101 110110 111101 110010
011011 000110 010000 100001
Decimal
representation in
groups of 6 bits
18 6 21 44 27 6 60 32 21 54 61 50 27 6 16 33
Base64 encoded string SGVsbG8gV29ybGQh
Base64 Decoding
Base64 encoded
string
SGVsbG8gV29ybGQh
Decimal
representation of
text in groups of
6 bits
18 6 21 44 27 6 60 32 21 54 61 50 27 6 16
33
Bit representation of
text in groups of 6
bits
010010 000110 010101 101100 011011
000110 111100 100000 010101 110110
111101 110010 011011 000110 010000
100001
Bit representation of
text
01001000 01100101 01101100 01101100
01101111 00100000 01010111 01101111
01110010 01101100 01100100 00100001
ASCII Text Hello World!
Thank you

Base-64 Presentation

  • 1.
  • 2.
    What is Base64? Base64encoding is a process of converting binary data to an ASCII string format. When to use Base64? The need for Base64 encoding comes from the problems that occur when media (Image,Video) is transmitted in raw binary format to text- based systems. Since text-based systems (like email) interpret binary data as a wide range of characters, including special command characters, much of the binary data that is transmitted to these systems is misinterpreted and lost or corrupted in the transmission process.
  • 3.
    In other words,these encodings are necessary for transmission of data when the channel (like Email) does not allow binary data. Base64 Encoding Let’s understand Base64 encoding through an example ASCII Text Hello World! Bit representation of text 01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 00100001 Bit representation of text in groups of 6 bits 010010 000110 010101 101100 011011 000110 111100 100000 010101 110110 111101 110010 011011 000110 010000 100001 Decimal representation in groups of 6 bits 18 6 21 44 27 6 60 32 21 54 61 50 27 6 16 33 Base64 encoded string SGVsbG8gV29ybGQh
  • 4.
    Base64 Decoding Base64 encoded string SGVsbG8gV29ybGQh Decimal representationof text in groups of 6 bits 18 6 21 44 27 6 60 32 21 54 61 50 27 6 16 33 Bit representation of text in groups of 6 bits 010010 000110 010101 101100 011011 000110 111100 100000 010101 110110 111101 110010 011011 000110 010000 100001 Bit representation of text 01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 00100001 ASCII Text Hello World!
  • 5.