What is Base64?
Short answer: Base64 is an encoding scheme that converts binary data to an ASCII text string using 64 safe characters (A-Z, a-z, 0-9, +, /).
Detailed explanation
Base64 was created to transmit binary data (images, files) through protocols that only support text, like email (MIME) or JSON. Each 3 bytes of binary data are represented as 4 ASCII characters, increasing size by ~33%. It is NOT encryption: anyone can decode Base64 instantly. Its purpose is transport, not security.
Example
Text: 'Hello' → Base64: 'SGVsbG8='
Common use cases
- ▸Embedding small images in CSS (data: URLs)
- ▸Email attachments (MIME encoding)
- ▸JWT tokens (payload portion)
- ▸Storing binaries in JSON or XML
- ▸Basic Auth in HTTP headers
Frequently asked questions
Is Base64 encryption?
No. It is an encoding, not a cipher: anyone can decode it in a second. Never use it to protect a password or a token.
Why does Base64 make files bigger?
Because it represents every 3 bytes with 4 characters. The result is roughly 33% larger than the original binary.
Where is Base64 used in practice?
Email attachments, data URIs for small images in CSS, JSON payloads carrying binary data, and JWT tokens.
🇲🇽 También disponible en español