← Back to Library Cybersecurity Beginner 6 min read

What Is Base64 Encoding? Why It Is NOT Encryption

Base64 is a binary-to-text encoding scheme that represents arbitrary binary data (images, files, bytes) using a clean set of 64 safe ASCII characters.

💡 Plain-English Analogy

Many older communication channels (like email protocols and URL query strings) get corrupted if you try to send raw binary bytes through them. Base64 is like translating weird alien binary symbols into standard English letters (A-Z, a-z, 0-9, +, /) so they travel safely through any text channel without scrambling.

⚙️ Architecture & Under the Hood

Base64 groups binary data into 6-bit chunks (since 2^6 = 64). Three 8-bit bytes (24 bits total) are converted into four 6-bit Base64 indices, increasing payload size by approximately 33%. If the input length is not divisible by 3, equals signs (=) are appended as padding.

How 3 Bytes Become 4 Base64 Characters

Base64 groups 24 bits into four 6-bit indices mapped to the Base64 character table.

Input string: "Man"
ASCII decimal:     77          97         110
8-bit binary:   01001101    01100001    01101110
────────────────────────────────────────────────────
Regroup 6-bit:  010011   010110   000101   101110
Base64 index:     19       22        5       46
Base64 output:    'T'      'W'      'F'      'u'  ──▶ Result: "TWFu"

Frequently Asked Questions

What do the equal signs (=) mean at the end of a Base64 string?

The equal signs are padding characters. Because Base64 processes data in 3-byte blocks, if the input data has 1 or 2 remaining trailing bytes, padding characters are appended so the total output length remains a multiple of 4.