
Note: 6 input characters are encoded into 8 characters in the end. In the end, we're left with the String QUJDMTIz - the Base64 representation of ABC123.

If it's impossible to break it up into chunks of six, we have to pad the sequence.

There are five steps we take during this process:
#HOW TO ENCODE A MESSAGE AS X64 MANUAL#
Manual Encodingįor example, let's say we have a String - ABC123 that we'd like to encode in Base64. Let's go ahead and manually encode a simple String to get a good idea of how the process works. Though, this is impractical due to difficulties in the encoding/decoding process. You could go higher than this and have each character represent 8 bits. So 64 characters of Base64 can be written as:Įach character is represented in 6 bits. Note: There is also a 65th character ( =), which serves a special meaning and it's called a padding character.Īs usual, when it comes to computers, numbers are represented in powers of 2. In Base64, as the name suggests, there are 64 characters used to encode binary data. While it does "obscure" the data to a degree, it's not a secure format by any means. What Base64 isn't is an encryption algorithm. It's very useful for storing image/audio information in Strings of information. It's represented as printable ASCII characters where each Base64 character contains 6 bits of binary information. What is Base64?īase64 is a binary-to-text encoding scheme.

Decoding is the reverse process of encoding - turning the encoded data back to the original format.Įncoding is all around us and computers heavily rely on different encoding formats to deliver and transfer information.įrom the latest cat image in your feed to the voice message you listened to over a messaging app - all of these were encoded on the sender-side, delivered to you, and decoded on the recipient-side.Įncoding makes sure that data remains intact and efficient for transport. The process of converting data by applying some techniques/rules into a new format is called encoding.
