Base64 Encode & Decode
How Base64 Encoding Works
Base64 converts binary data into a text representation using 64 characters.
- 1
Input text is converted to bytes
The input string is first converted to its binary byte representation using UTF-8 encoding.
- 2
Bytes are grouped into 3-byte chunks
The binary data is divided into groups of 3 bytes (24 bits).
- 3
Each chunk is split into 4 6-bit indices
Each 24-bit group is split into four 6-bit values, each representing an index (0-63).
- 4
Indices are mapped to characters
Each 6-bit index maps to a character in the Base64 alphabet (A-Z, a-z, 0-9, +, /).
FAQ
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to encode data for transmission over media designed to handle text.
Is Base64 encryption?
No, Base64 is encoding, not encryption. It does not provide any security or data protection. Anyone can decode Base64 data. Use encryption algorithms like AES for security.
What is Base64URL?
Base64URL is a URL-safe variant of Base64 that replaces + with - and / with _, and removes padding = characters. It is used in JWT tokens and URLs.
Does Base64 increase data size?
Yes, Base64 encoding increases data size by approximately 33%. Every 3 bytes of input become 4 bytes of Base64 output.