Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text. Supports UTF-8, URL-safe Base64, MIME and PEM line break formats.
Output format
Common Base64 Use Cases
| Use Case | Note |
|---|---|
| HTTP Basic Auth | Encodes username:password — easily decoded, not for security |
| Data URI (image) | Embeds images inline in HTML/CSS without a separate HTTP request |
| JWT payload | URL-safe Base64 (no padding) encodes the header and payload sections |
| MIME email attachment | RFC 2045 requires 76-character line breaks in email bodies |
| PEM certificate / key | RFC 7468 requires 64-character line breaks for SSL/TLS certificates |
| URL query parameter | URL-safe mode replaces + with – and / with _ to avoid URL-encoding issues |
Frequently Asked Questions
Base64 encoding converts binary data or text into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It groups input bytes in sets of 3 (24 bits) and maps them to 4 Base64 characters, so encoded output is about 33% larger than the original. It is widely used in HTTP Basic Auth, data URIs, JWT tokens, MIME email attachments, and PEM certificates — anywhere binary data must travel through a text-only channel.
Use URL-safe Base64 when the encoded string will appear in a URL, query parameter, or JWT. Standard Base64 uses + and / which have special meaning in URLs and require percent-encoding (%2B and %2F). URL-safe Base64 replaces + with – and / with _, and omits the = padding characters, making the output safe for use in URLs, filenames, and JWT header/payload sections without any additional encoding.
No — Base64 is encoding, not encryption. Anyone who receives a Base64 string can decode it instantly without any key or password. It is a reversible transformation designed to make binary data representable as ASCII text. Never use Base64 alone to protect sensitive data. For actual security, use encryption algorithms such as AES (symmetric) or RSA (asymmetric) before optionally encoding the ciphertext in Base64.
Some protocols require Base64 output to be split into fixed-length lines. MIME (RFC 2045), used for email attachments, requires a line break (\r\n or \n) every 76 characters. PEM (RFC 7468), used for SSL/TLS certificates and private keys, requires a line break every 64 characters and adds -----BEGIN CERTIFICATE----- / -----END CERTIFICATE----- headers. If you are copy-pasting a certificate or preparing an email attachment, choose the matching line-break format.