How the Base64 Encoder and Decoder Works
Our Base64 Encoder and Decoder allows you to convert text to and from Base64 format securely in your browser.
Browser-Based Conversion
Our tool uses standard browser APIs for the conversion process:
- Encoding: To convert text to Base64, we use the
btoa()method. If the text contains non-ASCII characters, we use a custom encoding approach to ensure UTF-8 compatibility. - Decoding: To convert Base64 back to text, we use the
atob()method.
UTF-8 Support
Standard Base64 encoding often struggles with special characters (like emojis or non-English characters). We handle this by using a robust method:
- Step 1: Encode the input string as a UTF-8 byte array using
TextEncoder. - Step 2: Convert each byte into its corresponding character representation.
- Step 3: Use
btoa()to create the final Base64 string.
This ensures that any character you enter is preserved correctly across the conversion.
Privacy First
Your data is handled entirely on your computer:
- No Data Transmission: The text you enter and the resulting Base64 output never leave your browser.
- Safe for Secrets: It is secure to use this tool for encoding API keys, tokens, or credentials, as they are never transmitted over the internet.
- Zero Retention: Once you refresh or close the page, your data is gone.
Verification
You can verify that this tool is 100% private by checking your browser's Network tab (F12). No requests to any server are made when you click "Encode" or "Decode".