Loading...
Encode and decode text to and from Base64 with UTF-8 support for international characters
Base64 encoding converts binary data into a 64-character subset of ASCII characters (A-Z, a-z, 0-9, +, /). The algorithm processes input data in 3-byte groups, converting each group into 4 Base64 characters. If the input length is not a multiple of 3, padding with = characters is added. This tool uses the btoa() and atob() JavaScript methods with proper UTF-8 handling via encodeURIComponent() and decodeURIComponent() to ensure international characters are encoded correctly. The decoding process reverses this, converting Base64 back to the original binary data or text.
How to convert base64 image to file?
Decode the base64 string and create a Blob, then use URL.createObjectURL() to generate a downloadable link. Most modern browsers support this natively.
Is base64 encoding secure?
Base64 is encoding, not encryption. It's reversible and provides no security. Use it for data transmission, not for protecting sensitive information.
What's the size overhead of base64?
Base64 increases file size by approximately 33% (4 characters for every 3 bytes). Consider this for large files or bandwidth-constrained applications.
Can I encode Unicode text?
Yes, but you must first encode Unicode text to UTF-8 bytes before base64 encoding. This tool handles UTF-8 automatically.
JavaScript Encode: btoa(unescape(encodeURIComponent(text)))
JavaScript Decode: decodeURIComponent(escape(atob(base64String)))
Node.js: Buffer.from(text, 'utf8').toString('base64')