100% Client-Side • No Data Leaves Your Browser
Base64 Encoder & Decoder
Encode text or files to Base64 instantly, or decode Base64 strings back to readable text. Auto-detect mode, drag-and-drop file support, line-wrap toggle, and byte-size stats.
Auto-detect: paste input to detect
Drop any file here or click to browse
Encode: any file → Base64 | Decode: paste Base64 below and click Download
Input text
Base64 output
Base64 Alphabet Reference
| Value | Char | Value | Char | Value | Char | Value | Char |
|---|
Frequently Asked Questions
Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters using 64 printable characters (A–Z, a–z, 0–9,
+ and /). It's used whenever binary data needs to be stored or transmitted over text-based systems — like embedding images in HTML with data: URIs, encoding email attachments in MIME, storing binary data in JSON or XML, and transmitting data in HTTP headers. Base64 adds about 33% overhead (3 bytes become 4 characters).No — Base64 is encoding, not encryption. Encoding transforms data into a different format for compatibility. It has no secret key and anyone can decode Base64 instantly. If you decode
SGVsbG8gV29ybGQ= you get Hello World. Never use Base64 to protect sensitive data like passwords, API keys, or personal information. For security, use proper encryption algorithms like AES-256 or RSA. Base64 provides zero confidentiality.Standard Base64 uses
+ (plus) and / (slash) as the 62nd and 63rd characters. These have special meaning in URLs: + is decoded as a space in query strings, and / separates URL path segments. URL-safe Base64 (RFC 4648) replaces + with - (hyphen) and / with _ (underscore), and typically removes the = padding. JWTs (JSON Web Tokens) use URL-safe Base64. To convert this tool's output to URL-safe Base64: replace +→-, /→_, and remove trailing =.The MIME standard (RFC 2045) requires Base64-encoded data to be broken into lines of no more than 76 characters, each terminated by a line break. This was required for old email systems that couldn't handle very long lines. Modern systems generally accept Base64 without line breaks, but some legacy protocols, config files, PEM certificates, and email systems still require the 76-character wrap. Toggle "MIME line wrap" in the options bar to switch between wrapped and compact (no wrap) output.
Click the "File" tab above, then drag and drop any file onto the drop zone (or click to browse). The tool reads the file as binary data and outputs the complete Base64 string. This is useful for embedding small images or fonts directly in HTML/CSS using
data: URIs, or encoding binary files for transmission in JSON or YAML. For the reverse (Base64 → file), switch to Decode mode, paste your Base64 string, and click "Download" to save the decoded file.Standard
btoa() in JavaScript only handles ASCII (Latin-1) characters. For Unicode text, you must first encode the string to UTF-8 bytes, then convert those bytes to Base64. This tool handles UTF-8 automatically in "UTF-8" charset mode — just paste your text including emoji and international characters and it encodes correctly. In "ASCII" mode, non-Latin characters will be replaced with ?. Always share the charset used when exchanging Base64 encoded text.Deep Dive
Base64 Encoding Explained: How It Works, When to Use It & Common Mistakes →
1,500+ word guide covering the algorithm, use cases, security pitfalls, and code examples in JavaScript and Python.
Related Tools
Developer Tool
Image to Base64
Convert images to Base64 data URIs for inline embedding in HTML or CSS
Developer Tool
Data URI Encoder
Encode files to Base64 data URIs with the correct MIME type prefix
Developer Tool
URL Encoder & Decoder
Percent-encode and decode URL strings with auto-detect and batch mode
Developer Tool
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-512 hashes from text or files