Text โ Base64 ยท Image to Data URL ยท Drag & Drop ยท Real-time Preview
Convert text or image files to Base64 strings.
Click or drag an image here
Image Preview / Base64 Result
Decode Base64 strings to original text or image.
Base64 is a standard method to encode binary data using 64 printable characters. Widely used in data transmission, embedded images, URL parameter encoding. ng.cc offers a free online Base64 tool that converts text or images to Base64, generates Data URLs, supports drag-and-drop, with all processing done locally in your browser.
Supports English, Chinese, and special characters with UTF-8 encoding to prevent garbled text.
Upload images to generate full Data URLs for HTML img tags, CSS background, or mini apps.
Detect if input is text or image. Show preview for images, text result for text strings.
All actions occur in browser. Images never leave your device.
Base64 encodes 3 bytes into 4 characters. Result is ~33% larger than original.
Data URL embeds small files inline. Format: data:[<mediatype>][;base64],<data>. Useful for img src.
All encoding uses UTF-8 to prevent issues. Other tools may use wrong charset.
Not encryption. Anyone can decode. Do not encode passwords or sensitive data. Use AES or other encryption if needed.