Loading
Loading
Free online tool
Encode text or files to Base64 format, or decode Base64 back to its original form — instantly and securely in your browser.
Privacy: All processing happens locally in your browser. No text or files are uploaded or sent to any server.
Base64 is a binary-to-text encoding scheme that converts arbitrary binary data into a string of printable ASCII characters. It is one of the most widely used encoding methods in software development, used to embed images directly in HTML and CSS, transmit binary files over text-based protocols like email (MIME) and HTTP, encode authentication credentials in API headers (Basic Auth), and store binary blobs in JSON or XML documents. This free online Base64 Encoder & Decoder handles both text strings and binary files, supports Standard and URL-Safe character sets, and processes everything locally in your browser for complete privacy.
For encoding, the tool first converts your input text into a UTF-8 byte array using the TextEncoder API — this is what enables proper handling of Unicode characters, emojis, and non-Latin alphabets that would cause errors with the browser's native btoa() function. The byte array is then processed in chunks, converting every three bytes into four Base64 characters using the standard Base64 alphabet (A–Z, a–z, 0–9, +, /). When URL-Safe mode is selected, '+' is replaced with '-' and '/' with '_', and padding '=' characters are removed. For file encoding, the FileReader API reads the file as a Data URI, and the tool extracts or displays the raw Base64 string. Decoding reverses this process, converting Base64 characters back into a byte array and then into the original text or file.
You want to embed a company logo directly in an HTML email template so it displays without external image hosting.
Your email now displays the logo inline without depending on an external image server, improving deliverability and ensuring the image renders even when external images are blocked by the email client.
No. All encoding and decoding processing happens entirely in your browser using local client-side JavaScript APIs. No files, text, or keys are ever sent to any remote server or stored anywhere.
Standard Base64 contains the characters '+' and '/' which have special meaning in URLs. URL-Safe Base64 (RFC 4648 Section 5) replaces '+' with '-' and '/' with '_'. It also typically removes the '=' padding characters, making the encoded text safe to pass in URL query parameters or HTTP requests without URL encoding.
Standard browser window.btoa only accepts binary/Latin-1 strings (0-255 range). Pasting Unicode characters like emojis, Chinese characters, or non-Latin alphabets usually throws a character range error. This tool converts input text into a UTF-8 byte array using TextEncoder before base64 encoding, ensuring Unicode strings encode and decode without corruption.
We limit files to 10 MB to ensure your browser remains fast and responsive. Large files require significant memory allocations during base64 conversion and can freeze or crash the browser page.
Yes! When you upload an image file in File Mode, the tool provides quick helper buttons to copy a pre-formatted HTML <img> tag or a CSS background-image style using the generated Base64 Data URI.
Base64 encoding represents every 3 bytes of input as 4 ASCII characters, resulting in approximately 33% size overhead. This is by design — the trade-off is that the encoded output uses only printable ASCII characters, making it safe for transmission over text-only protocols like email or embedding in JSON/HTML/CSS.
Base64 encoding is a fundamental building block of modern web development — from embedding images in HTML to transmitting binary data over APIs. This free Base64 Encoder & Decoder handles text and files with full Unicode support, URL-Safe character sets, and ready-to-use output formats, all running entirely in your browser. No sign-ups, no data collection, and no server involvement.