Base64 uses only 64 safe ASCII characters (AโZ, aโz, 0โ9, +, /) to represent binary data. Every 3 bytes of input becomes 4 Base64 characters โ making it about 33% larger than the original.
Select the Encode tab to convert text or a file to Base64, or the Decode tab to convert a Base64 string back to its original form.
For text encoding: type or paste your text. For file/image encoding: upload the file and receive its Base64 data URI โ ready to use in HTML or CSS.
Select Standard Base64, URL-Safe Base64 (replaces + with - and / with _ for use in URLs), or Base64 without padding (removes trailing = signs).
Copy the encoded/decoded string to clipboard. For file decoding, download the reconstructed file. For images, preview the decoded image directly in the tool.
| Use Case | How Base64 Is Used | Example |
|---|---|---|
| API Authentication | HTTP Basic Auth encodes username:password | Authorization: Basic dXNlcjpwYXNz |
| Email Attachments | MIME standard encodes binary attachments as Base64 text | PDF inside email body |
| Image Data URIs | Embed images directly into HTML/CSS without file requests | src="data:image/png;base64,..." |
| JWT Tokens | Header and payload of JSON Web Tokens are Base64Url encoded | eyJhbGciOiJIUzI1NiJ9... |
| CSS Fonts | Embed custom fonts directly in CSS stylesheets | src: url("data:font/woff2;base64,...") |
| Cryptography | Encode binary keys, certificates, and signatures as text | SSH public key format |
| Data URLs | Store small files inline in HTML without separate file requests | Favicon, small icons |
Embed images, fonts, and icons as data URIs to eliminate HTTP requests.
Encode credentials and binary data for HTTP Basic Auth and API payloads.
Encode/decode JWT tokens, TLS certificates, and SSH keys.
Debug MIME-encoded email attachments and HTML email bodies.
Decode Base64 payloads from API responses and browser local storage.
Encode images and binary assets for transmission in JSON-based mobile APIs.
Base64 is encoding, not encryption. Anyone can decode it instantly. Never use Base64 to "hide" sensitive data โ use proper encryption (AES, RSA) for security.
Standard Base64 uses + and / which are special characters in URLs. For Base64 in URLs or filenames, use the URL-safe variant that replaces them with - and _ instead.
Base64 increases file size by ~33%. For large files (images, videos), don't embed them as Base64 data URIs โ serve them as separate files instead. Data URIs are best for files under 5KB.
Convert small icons or background images to Base64 and embed them in CSS. This reduces HTTP requests but works best for small images only โ large ones slow page rendering.