Base64 Encode
Free online Base64 encode/decode tool. UTF-8/ASCII/ISO-8859-1, Standard/URL-Safe/MIME, real-time overhead, RFC 2045 compliant.
Free online Base64 encode/decode tool. UTF-8/ASCII/ISO-8859-1, Standard/URL-Safe/MIME, real-time overhead, RFC 2045 compliant.
No. Base64 is a reversible encoding anyone can decode. For sensitive data use AES. Base64 only converts data format for text-safe transmission.
AES EncryptionApproximately 33%. Every 3 bytes become 4 characters. Example: Hello → SGVsbG8= (+33%).
Standard uses +/; URL-Safe replaces with -_ for URLs/JWT; MIME wraps at 76 chars per RFC 2045 for email.
URL-SafeMIMEJWT uses Base64URL. Select URL-Safe mode and paste the second segment.
JWT Tool= characters added when input is not a multiple of 3 bytes, making output length a multiple of 4.
Padding Toolbtoa/atob only support Latin-1 (1 byte per char). Use encodeURIComponent + unescape for UTF-8 strings.
Format: data:[mediatype][;base64],<data>. Embeds files directly in URLs for reduced HTTP requests.
Data URIBase64 to ImageBase64 is a binary-to-text encoding using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /), defined in RFC 2045/4648. It converts every 3 bytes into 4 characters for safe text-system transmission.
**Base64 is NOT encryption.** It is reversible and anyone can decode it. Use AES for sensitive data. Used in HTTP Basic Auth, JWT, Data URIs, and MIME email.
**URL-Safe Base64** (RFC 4648 §5) replaces +/ with -_ and omits padding = for URL/filename safety. Used in JWT, OAuth PKCE.
**MIME** wraps at 76 chars per RFC 2045 for email compatibility.
Uses native btoa/atob with UTF-8-safe processing. All computation is local in your browser.
| Feature | Standard | URL-Safe | MIME |
|---|---|---|---|
| Special chars | + / | - _ | + / |
| Padding (=) | Used | Omitted | Used |
| Line breaks | None | None | Every 76 chars |
| Standard | RFC 4648 §4 | RFC 4648 §5 | RFC 2045 |
| Use cases | Data URI, general | JWT, URL, filenames | Email, SMTP |
| Encoding | Chars | Charset | Overhead | Use Case |
|---|---|---|---|---|
Base16 (Hex) | 16 | 0-9, A-F | 100% | Debugging, hashes |
Base32 | 32 | A-Z, 2-7 | 60% | DNS, TOTP, QR |
Base58 | 58 | No 0/O/I/l | 38% | Bitcoin, crypto |
Base62 | 62 | A-Z,a-z,0-9 | 34% | URL shorteners |
Base64 | 64 | A-Z,a-z,0-9,+,/ | 33% | Data URI, MIME, JWT |
// UTF-8 safe Base64 encode
function b64Encode(str) {
return btoa(unescape(encodeURIComponent(str)));
}
function b64Decode(str) {
return decodeURIComponent(escape(atob(str)));
}
function b64UrlEncode(str) {
return btoa(unescape(encodeURIComponent(str)))
.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
}
console.log(b64Encode('Hello World'));import base64
encoded = base64.b64encode('Hello World'.encode('utf-8'))
print(encoded.decode())
decoded = base64.b64decode(encoded).decode('utf-8')
print(decoded)
url_safe = base64.urlsafe_b64encode('Hello World'.encode('utf-8'))
print(url_safe.decode().rstrip('='))import java.nio.charset.StandardCharsets;
import java.util.Base64;
public class Base64Example {
public static void main(String[] args) {
String text = "Hello World";
String encoded = Base64.getEncoder().encodeToString(text.getBytes(StandardCharsets.UTF_8));
System.out.println(encoded);
String decoded = new String(Base64.getDecoder().decode(encoded), StandardCharsets.UTF_8);
System.out.println(decoded);
String urlSafe = Base64.getUrlEncoder().withoutPadding().encodeToString(text.getBytes(StandardCharsets.UTF_8));
}
}