Text to Base64
Encode text to Base64 and decode Base64 back to text instantly
Text to Base64 encoder and decoder. Convert text to Base64 encoding and decode Base64 strings back to readable text. Handles Unicode, emojis, and binary data
Text to Base64 encoder and decoder. Convert text to Base64 encoding and decode Base64 strings back to readable text. Handles Unicode, emojis, and binary data
Base64 encoding converts arbitrary text into a safe ASCII representation that can be transmitted across systems designed for text-only data. This tool handles both encoding and decoding:
Base64 encoding operates on a simple mathematical principle: it converts every 3 bytes (24 bits) of input data into 4 characters from a 64-character alphabet. Each Base64 character represents exactly 6 bits of data (since 2^6 = 64). The encoding process takes 3 input bytes, splits them into four 6-bit groups, and maps each group to a character in the Base64 table: A-Z (values 0-25), a-z (values 26-51), 0-9 (values 52-61), + (value 62), and / (value 63). When the input length isn't divisible by 3, padding characters (=) are added to ensure the output length is a multiple of 4. For example, encoding 'Man' (3 bytes: 0x4D, 0x61, 0x6E) produces 'TWFu' (4 Base64 characters). Encoding 'Ma' (2 bytes) produces 'TWE=' (4 characters with one padding =). Encoding 'M' (1 byte) produces 'TQ==' (4 characters with two padding =). This 4/3 expansion ratio explains why Base64-encoded data is about 33% larger than the original. The encoding is deterministic — the same input always produces the same output — and reversible without loss of information, making it an encoding scheme rather than encryption. Understanding this mechanism helps diagnose common issues: unexpected padding characters indicate input length issues, and garbled output usually means the wrong character set was used during encoding or decoding.
Base64 encoding solves a fundamental problem: how to transmit binary or special-character data through systems that only handle plain ASCII text. In web development, Base64-encoded images are embedded directly in HTML and CSS using data URIs, eliminating separate HTTP requests for small images like icons and decorative elements. Email protocols (SMTP, IMAP) use Base64 to encode attachments, allowing binary files to travel through text-based mail systems. OAuth 2.0 authentication headers encode credentials as Base64: 'Authorization: Basic dXNlcjpwYXNz' decodes to 'user:pass'. JSON APIs sometimes Base64-encode binary fields (like profile pictures or document thumbnails) to maintain pure JSON structure without requiring multipart/form-data uploads. Configuration management tools store secrets and API keys as Base64-encoded strings in environment variables and config files, avoiding issues with special characters breaking shell parsing. URL-safe Base64 variants replace + with - and / with _ to prevent encoding conflicts with URL syntax, commonly used in JWT tokens and API query parameters. SVG images embedded in HTML are often Base64-encoded to avoid external file dependencies. Understanding these use cases helps you decide when Base64 encoding is the right tool versus when alternatives like hex encoding, URL encoding, or direct binary transmission would be more appropriate.
Base64 is an encoding scheme that converts binary data or text into an ASCII string using 64 characters (A-Z, a-z, 0-9, +, /) plus padding (=). It expands data by ~33% but ensures the result contains only safe ASCII characters suitable for transmission through text-based systems like email, URLs, and JSON.
No. Base64 is encoding, not encryption. Anyone can decode a Base64 string back to its original form — there is no key or password involved. Never use Base64 to hide or protect sensitive data. Use proper encryption (AES, RSA) for security. Base64 merely changes the representation format, not the confidentiality.
The '=' characters are padding. Base64 encodes data in groups of 3 bytes into 4 characters. When the input length isn't divisible by 3, padding characters are added to make the output length a multiple of 4. One '=' means 2 input bytes were encoded; two '=' means 1 input byte was encoded.
Yes. The tool encodes UTF-8 text, which includes all Unicode characters: accented letters (é, ñ, ü), CJK characters (中文, 日本語), Arabic, Cyrillic, and emojis (🚀, 😀). The UTF-8 encoding of these characters is then Base64-encoded, preserving all information for accurate round-trip decoding.
Standard Base64 uses '+' and '/' as two of its 64 characters. URL-safe Base64 replaces '+' with '-' and '/' with '_' to prevent conflicts with URL syntax. Standard Base64 is used in email and general data encoding; URL-safe Base64 is used in JWT tokens, API parameters, and data URIs embedded in URLs.
Yes. All encoding and decoding happens locally in your browser using JavaScript. Your text never leaves your device, is never transmitted to any server, and is never stored or logged.