Base64 Encoder
/ Decoder
Encode text or files to Base64 and decode Base64 back to text or binary — all processing happens instantly in your browser with full Unicode support.
What Is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data as a string of printable ASCII characters. Every three bytes of input become four characters of output, using the alphabet A–Z, a–z, 0–9, +, and /, with = as padding. It is one of the most widely used encoding formats on the web, appearing in data URIs, email attachments, API tokens, and configuration files.
Our Base64 Encoder / Decoder converts text and files in both directions instantly in your browser. Paste text, upload a file, toggle URL-safe mode or MIME line breaks, and get the result in one click — no sign-up, no server upload, no data collection.
The encoder supports full Unicode text using the encodeURIComponent + unescape technique, so emoji, CJK characters, and all multi-byte sequences survive the round-trip without corruption. For files, the tool reads the binary as an ArrayBuffer and encodes it in chunks for smooth performance even with large files.
The decoder auto-detects URL-safe encoding (- and _ instead of + and /), handles missing padding, and checks whether the result is text or binary. If the decoded data is an image, a live preview is rendered. If it is another binary format, you can download the file directly. Everything runs on your device — close the tab and nothing remains.
Discover Features
Bi-directional encoding, URL-safe mode, file support, image preview, and full privacy — all on your device
Bi-Directional Conversion
Switch between Encode and Decode with a single tab click. Both directions handle text input, clipboard paste, and file uploads so you never need a second tool.
Full Unicode Support
Encode and decode any Unicode text — emoji, CJK characters, Arabic, Cyrillic, and more. The tool uses encodeURIComponent + unescape for lossless round-trip conversion.
URL-Safe Base64
Toggle URL-safe encoding that replaces + with -, / with _, and strips padding. Perfect for embedding Base64 in URLs, filenames, and query parameters without percent-encoding.
File Upload & Encoding
Upload any file type — images, PDFs, documents, binaries — and encode it to Base64 instantly. Large files are processed in chunks for smooth performance without freezing the browser.
Image Preview on Decode
When decoding a Base64 string that contains an image (PNG, JPEG, GIF, WebP), the tool auto-detects the format and renders a live preview right below the output.
100% Private & Secure
All encoding and decoding happens entirely in your browser. Nothing is sent to any server. Close the tab and nothing remains — ideal for API keys, tokens, and sensitive payloads.
How to Use
Four steps: choose a mode, enter input, convert, and copy or download
Choose Encode or Decode
Select the Encode tab to convert text or files to Base64, or the Decode tab to convert Base64 back to readable text or binary.
Enter or upload your input
Type, paste, or upload a file into the input area. For encoding, any text or file works. For decoding, paste a valid Base64 string.
Set options and convert
Toggle URL-safe mode or MIME line breaks if needed, then click Encode or Decode. The result appears instantly in the output area.
Copy, download, or swap
Copy the result to your clipboard, download it as a file, or hit Swap to feed the output back as input in the opposite mode.
Use Cases
Common scenarios where Base64 encoding and decoding saves time and simplifies data handling
Embedding Data in Code
Encode small images, fonts, or binary assets as Base64 data URIs to embed directly in HTML, CSS, or JavaScript — eliminating extra HTTP requests.
API Authentication
Many APIs require Base64-encoded credentials in HTTP headers (e.g., Basic Auth). Quickly encode your username:password pair for testing with curl or Postman.
Email & MIME Attachments
SMTP and MIME encode binary attachments as Base64 with 76-character line breaks. Use MIME mode to produce spec-compliant output ready for email payloads.
Database Storage
Store binary blobs (images, documents) in text-only database columns by encoding them as Base64. Decode them back when retrieving for display or download.
JWT & Token Inspection
Decode the header and payload sections of JSON Web Tokens (JWTs) to inspect claims, expiration, and issuer without needing a dedicated JWT debugger.
Data Transfer & Debugging
Copy binary data between systems that only support text (chat, tickets, config files). Base64 guarantees safe transport through any text-based channel.
Free vs Paid — Base64 Encoder
Get started free, upgrade when you need more power.
Unlock the Full Power of Base64 Encoder
Remove daily limits, process larger files up to 500 MB, enable batch processing, and get priority support.
Developer Tools includes:
- 13 developer & utility tools
- Unlimited daily uses
- No file size limits
- All output formats
Also available in the All Tools Bundle
FAQ
Frequently asked questions about the Base64 Encoder / Decoder
Q1. What is Base64 encoding?
Q2. Is my data safe?
Q3. What is URL-safe Base64?
Q4. Why does Base64 make data larger?
Q5. Can I encode files, not just text?
Q6. How does the tool handle Unicode text?
Q7. What are MIME-style line breaks?
Q8. What happens when I decode a binary file?
Related Tools
Encode and decode Base64, then try these other utility tools