ASCII to Base64 Converter
Convert ASCII text to Base64 encoding online instantly. URL-safe mode and line break options included.
Paste ASCII text on the left and the Base64 string appears on the right. Flip on URL-safe mode when the result needs to sit inside a URL, or add 76-character line breaks for MIME-compliant email payloads. And everything runs in your browser. Nothing gets uploaded.
How to Use
Enter your ASCII text in the left input panel. You can type directly or paste content.
Configure options -- toggle URL-safe mode to replace +/ with -_ and remove padding, or enable line breaks every 76 characters (MIME standard).
Click Convert or leave Live mode enabled to encode automatically as you type.
Copy or Download the Base64 result using the toolbar buttons.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, and /). It converts every 3 bytes of input into 4 Base64 characters, with "=" padding added when the input length is not a multiple of 3. Base64 is widely used to embed binary data in text-based formats like JSON, XML, HTML, and email (MIME).
What is URL-safe Base64?
URL-safe Base64 replaces the standard "+" character with "-" and "/" with "_", and typically omits the "=" padding characters. This variant is used when Base64 data needs to be included in URLs, query parameters, or file names where the standard characters could cause parsing issues. It is defined in RFC 4648 as "base64url".
Why add line breaks every 76 characters?
The MIME standard (RFC 2045) requires that Base64-encoded content in email messages be broken into lines of no more than 76 characters. This ensures compatibility with older mail servers and text-processing tools that may have line-length limits. For most web and API use cases, line breaks are not needed.
Can non-ASCII characters be encoded with this tool?
This tool is designed for ASCII text (characters 0-127). If your input contains non-ASCII characters such as accented letters or emoji, the tool will first encode the text as UTF-8 bytes and then Base64-encode those bytes. For pure ASCII input, btoa() handles the conversion directly.
Is my data safe when using this tool?
Yes. All encoding is performed entirely in your browser using JavaScript. No data is sent to any server. Your input text and the Base64 output never leave your device, making it completely safe for encoding sensitive or private information.