Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation.
Now is an example of Base64 decoder:
You can see the Encoder/Decoder work exactly.
What is Base64 Encoder?
Base64 Encoder is a process of converting binary data to an ASCII string format by converting that binary data into a 6-bit character representation.
Base64 Encoding Table
In order to understand how Base64 works, the first important thing you need to deal with is the Base64 Table.
Take a look at that table here.