Loading...
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII text format. It uses 64 characters (A-Z, a-z, 0-9, +, /) to represent data. Common uses include:
Standard Encoding:
Input: Hello World!
Output: SGVsbG8gV29ybGQh
Unicode Support:
Input: ไฝ ๅฅฝไธ็ ๐
Output: 5L2g5aW95LiW55WMIPCfjI0=
Base64 is a binary-to-text encoding scheme that converts binary data into an ASCII string format using 64 different characters (A-Z, a-z, 0-9, +, /). This encoding is essential for transmitting binary data over media designed to handle text, such as email systems, URLs, JSON APIs, and web storage.
Base64 divides input into groups of 3 bytes (24 bits), then splits those 24 bits into 4 groups of 6 bits each. Each 6-bit group is converted to one of 64 characters from the Base64 alphabet.
MIME protocol uses Base64 to encode binary attachments for email transmission
Embed images and files directly in HTML, CSS, or JSON without separate requests
Encode credentials for HTTP Basic Authentication headers
Uses A-Z, a-z, 0-9, +, / characters with = padding. Standard format for most applications.
Replaces + with -, / with _, removes = padding. Safe for URLs and file names.
Adds line breaks every 76 characters as per RFC 2045 for email compatibility.
Our tool uses TextEncoder/TextDecoder APIs to properly handle Unicode characters including emoji, Chinese, Arabic, Cyrillic, and other international characters that standard btoa/atob functions cannot handle.
Upload any file (text, images, PDFs, etc.) and convert it to Base64. Supports both text and binary files with automatic detection and proper encoding.
Generate data URIs for embedding images and files directly in HTML, CSS, or JavaScript. Perfect for reducing HTTP requests and improving page load times.
Instant encoding and decoding as you type. Copy results with one click, download as files, or swap between encode and decode modes seamlessly.
Embed images directly in HTML without separate HTTP requests. Useful for small icons, logos, and inline graphics.
<img src="data:image/png;base64,iVBORw0KGgoAAAANS..." />Encode username:password for Basic Authentication headers in API requests.
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=Include binary data in JSON payloads for APIs that don't support multipart/form-data.
{ "file": "SGVsbG8gV29ybGQh", "type": "text/plain" }Embed background images in CSS to reduce HTTP requests and improve page load performance.
background-image: url(data:image/png;base64,iVBORw0...);Important Security Notice
Base64 is an encoding method, NOT encryption. It provides no security or privacy. Encoded data can be easily decoded by anyone. Never use Base64 alone to protect sensitive information like passwords, API keys, or personal data.
Perfect for transmitting binary data over text-based protocols
Use for small images and icons to reduce HTTP requests
Use URL-safe variant when encoding data for URLs
Base64 is not encryption - use AES, RSA for security
33% size increase makes Base64 inefficient for large files
Never use Base64 to "hide" sensitive information
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII text format using 64 characters (A-Z, a-z, 0-9, +, /). It's used to transmit binary data over media designed for text, such as email attachments (MIME), data URIs in HTML/CSS, API authentication headers, JSON payloads, and URL parameters. Base64 ensures binary data remains intact during transport across systems that only support text.
No, Base64 is NOT encryption or a security mechanism. It's simply an encoding format that makes binary data text-safe. Anyone can easily decode Base64 data back to its original form. Never use Base64 alone to protect sensitive information like passwords or credit card numbers. For security, use proper encryption methods like AES, RSA, or other cryptographic algorithms.
Base64 increases file size by approximately 33% because it uses 4 characters to represent every 3 bytes of data. This 4:3 ratio is necessary because Base64 uses only 64 printable ASCII characters to represent binary data. Each Base64 character represents 6 bits (2^6 = 64), so 4 characters are needed to represent 24 bits (3 bytes). This overhead is the cost of making binary data text-safe for transmission.
Yes! Modern Base64 encoders use UTF-8 encoding to properly handle all Unicode characters including emoji, Chinese, Arabic, Cyrillic, and other international scripts. The text is first converted to UTF-8 bytes, then those bytes are encoded to Base64. Standard JavaScript btoa() function doesn't support Unicode, but proper implementations using TextEncoder/TextDecoder APIs handle all Unicode characters correctly.
Standard Base64 uses + and / characters which have special meaning in URLs and need percent-encoding. URL-safe Base64 (Base64URL) replaces + with - (minus), / with _ (underscore), and removes = padding characters. This makes the encoded string safe for use in URLs, query parameters, and file names without requiring additional encoding. Use URL-safe Base64 when the encoded data will be part of a URL.
To embed images in HTML using Base64, create a data URI with format: data:[MIME-type];base64,[Base64-encoded-data]. Example: <img src='data:image/png;base64,iVBORw0KGgo...' />. This embeds the image directly in HTML, eliminating separate HTTP requests. Useful for small images, icons, and reducing page load requests. However, Base64 images increase HTML size by 33% and aren't cached separately, so use for small images only.
MIME Base64 format follows RFC 2045 specification for email attachments. It adds line breaks (CRLF) every 76 characters to ensure compatibility with email systems that have line length limitations. MIME format is required for email attachments and some legacy systems. Modern web applications typically use standard Base64 without line breaks, but MIME format is still essential for email protocols and MIME-compliant applications.
Yes, Base64 decoding doesn't require any key or secret. Base64 is a reversible encoding scheme, not encryption. Anyone with the Base64 string can decode it back to the original data using standard Base64 decoding algorithms available in any programming language or online tool.