What is Base64 Encoding?
Base64 encoding converts binary data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). Every 3 bytes of input are represented as 4 Base64 characters, making the output roughly 33% larger. It is widely used to embed images in CSS or HTML, transmit binary data in JSON APIs, and encode email attachments.
How to Use This Tool
- Select a mode: Text, File, or Image
- Paste or upload your content in the Input area
- The Base64 encoded output appears in the Output area instantly
- Copy or download the result from the Output area
- For non-ASCII text, open Advanced and set the correct Charset (e.g. GBK for Simplified Chinese)
Features
- Text Encoding — encode any text string to Base64
- File Upload — convert any text file to Base64 and download the result
- Image Upload & Preview — upload an image and see a live preview with resolution, type, and file size
- Charset Support — encode with UTF-8, GBK, Shift_JIS, and more
- URL-Safe Base64 — output RFC 4648 §5 format suitable for URLs and filenames
- 100% Browser-Based — your data never leaves your device
FAQ
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable characters. Every 3 bytes of binary data are encoded as 4 Base64 characters, so the output is roughly 33% larger than the original.
How do I encode text to Base64?
Paste your text into the Input field in Text mode. The encoded Base64 result appears in the Output field instantly.
How do I convert an image to Base64?
Switch to Image mode and drop your image file or click Choose Image. The tool generates the Base64 string and shows a live preview.
What is Base64URL?
Base64URL is a URL-safe variant that replaces + with - and / with _, and omits padding (=). It is safe to use in URLs, JWT tokens, and filenames.