Base64 Encode Text
Convert text into Base64 format. Secure, reversible encoding for data transmission.
Settings
Live Statistics
Continue with Related Tools
What is Base64 Encoding?
Base64 encoding is a method of converting binary data (or any data) into a text string using only 64 ASCII characters. This makes it safe to embed binary data in text-based formats like JSON, XML, URLs, and email.
For example, the text Hello World becomes SGVsbG8gV29ybGQ= when Base64 encoded.
Features
UTF-8 Support
Encode emojis, foreign characters, and special symbols correctly.
URL Safe Mode
Replace + and / for safe use in URLs and filenames.
Batch Processing
Encode multiple lines at once with line-by-line mode.
File Upload
Load `.txt`, `.json`, or `.csv` files and download encoded results.
Client-Side Only
All encoding happens in your browser. We never see your data.
Basic Auth Ready
Perfect for creating HTTP Basic Authentication headers.
How to use
- Input: Type or paste text to encode (e.g.,
username:password). - Options: Enable "URL Safe Mode" if using in URLs or file paths.
- Result: Copy the Base64 string or download it as a file.
Example - Basic Auth Header
Frequently Asked Questions
What is Base64 encoding?
Base64 is a way to represent binary data (or any data) in an ASCII string format using only 64 characters (A-Z, a-z, 0-9, +, /). It's used to safely transmit data over text-based systems like email, JSON, or URLs where certain characters could cause problems.
Why do I need to encode to Base64?
Common use cases include: (1) Basic Authentication: Encoding username:password for HTTP headers. (2) Data URLs: Embedding images in HTML/CSS. (3) JSON Transport: Sending binary data in JSON payloads. (4) Email Attachments: Encoding files for MIME messages.
Can I encode emojis and special characters?
Yes! This tool uses UTF-8 encoding, which means it correctly handles emojis (🚀), foreign languages (日本語), and special symbols (€, ñ). Many older Base64 tools only support ASCII and will fail or produce incorrect output for non-English text.
What is URL-safe Base64?
Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 replaces + with -, / with _, and removes = padding. Enable this mode when embedding Base64 in query parameters or file names.
How does batch mode work?
Batch mode processes each line independently. Paste a list of items (one per line), and each will be encoded separately. The output maintains the same line structure. Perfect for encoding multiple API keys, usernames, or JSON objects at once.
Can I upload a file to encode?
Yes! Click 'Upload' to load a .txt, .json, .csv, or .xml file. The tool will read and encode the entire contents. You can then download the Base64 result as a new file.
Is my data sent to your server?
No. All encoding happens entirely in your browser using JavaScript. We never see, store, or transmit your data. This makes it safe to encode passwords, API keys, or any sensitive information.
Why is my output longer than the input?
Base64 increases data size by approximately 33%. This is because every 3 bytes of input data is represented by 4 Base64 characters. It's a trade-off for safe, text-only transmission.
How do I create Basic Auth headers?
Type username:password (e.g., admin:secret123) into the input, encode it, and prepend Basic to the result. Full header: Authorization: Basic YWRtaW46c2VjcmV0MTIz.
What if I need to decode Base64?
Use the 'Base64 Decode' mode toggle at the top of the tool. It's the same interface—just paste Base64 text and get the original string back. It supports the same UTF-8 and URL-safe options.