Encode multiple inputs at once and export results
Encode/decode Base64 strings
π Data is encoded in the URL. Anyone with the link can view it.
0 characters
0 characters
Base64 encodes binary data into ASCII text. Commonly used for embedding images in HTML/CSS, encoding data in URLs, and storing complex data in JSON. Output is ~33% larger than input.
Showing 8 of 94 related tools
Get up and running in 30 seconds
Type or paste text into the input field, or drag and drop a file (images, documents, any binary data). The encoder handles both text and binary files seamlessly.
Click 'Encode' to convert your input to Base64 format, or 'Decode' to convert Base64 back to original text/file. The tool automatically detects invalid Base64 strings.
Select text encoding (UTF-8, ASCII, Unicode) and choose whether to enable URL-safe Base64 format. URL-safe Base64 replaces + and / with - and _ for safe use in URLs.
Copy the encoded/decoded result to clipboard with one click, or download as a file. For binary data, download preserves the original file format after decoding.
Understanding binary-to-text encoding for web APIs
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII string format using a 64-character alphabet. Developed in the 1980s, Base64 has become the standard method for encoding binary data in text-based formats like JSON, XML, and email (MIME).
The encoding works by dividing binary data into 6-bit chunks and mapping each chunk to one of 64 printable ASCII characters: A-Z, a-z, 0-9, +, and /. This allows binary data (images, files, certificates) to be transmitted over text-only channels that historically only supported 7-bit ASCII.
Base64 encoding is essential in modern web development for several critical use cases. Embedding small images directly in HTML/CSS as Data URLs eliminates additional HTTP requests, improving page load performance. JSON APIs can transmit binary attachments (PDFs, images, files) as Base64 strings since JSON is text-only and cannot natively handle binary data.
Email systems rely on MIME Base64 encoding to send attachments through text-based SMTP protocol. Authentication tokens (JWT), API keys, and certificates use Base64 to encode binary signatures and cryptographic data for safe transmission in HTTP headers and URLs.
Web developers encounter Base64 daily when working with image uploads, file attachments in REST APIs, authentication systems, data serialization, and cross-origin resource embedding. Understanding Base64 encoding is fundamental to web architecture.
Unlike Hex encoding (Base16) which uses 0-9 and A-F resulting in 100% size increase, Base64 is more efficient with only 33% overhead. URL encoding (percent encoding) escapes special characters but doesn't convert binary to text format. Base64 URL-safe variant (+/ β -_) allows encoded data to be used in URLs without percent encoding.
How developers use Base64 encoding daily
Embed small images (icons, logos, backgrounds) directly in HTML or CSS to reduce HTTP requests and improve page load performance. Data URLs use Base64 to encode image bytes as inline strings.
Send file uploads (PDFs, images, documents) through JSON REST APIs by Base64 encoding the binary file data. JSON cannot natively handle binary data, so Base64 encoding converts files to text strings.
JSON Web Tokens (JWT) use URL-safe Base64 encoding for header and payload sections. JWTs encode authentication claims as Base64 strings for safe transmission in HTTP Authorization headers and cookies.
Email protocols (SMTP, IMAP) are text-based and use Base64 encoding to send file attachments. MIME Content-Transfer-Encoding: base64 header indicates Base64-encoded binary data in email messages.
Master encoding, decoding, and advanced options
This Base64 encoder/decoder provides instant client-side encoding with support for both text and binary files. All processing happens in your browser using JavaScript's built-in btoa() and atob() functions, ensuring your data remains private and processing is instantaneous.
Type or paste your text into the input field and click "Encode". The tool converts text to Base64 using UTF-8 encoding by default, which properly handles international characters, emojis, and special symbols. For ASCII-only text, select ASCII encoding for slightly smaller output.
Paste a Base64 string and click "Decode". Invalid Base64 strings trigger an error message showing the problem (invalid character, incorrect padding, malformed string). The decoder automatically handles both standard and URL-safe Base64 formats.
Drag and drop any file (images, PDFs, documents, archives) onto the input area, or click to browse. The tool reads the binary file data and encodes it to Base64. Large files (10MB+) may take a few seconds to encode.
Text Encoding: Choose UTF-8 (default, supports all Unicode), ASCII (English only, smaller output), or UTF-16 (legacy, larger output).
URL-Safe Base64: Enable to replace + and / with - and _ characters. Required for Base64 in URLs, filenames, or anywhere + and / have special meaning. JWT tokens always use URL-safe Base64.
Line Breaking: Add line breaks every 76 characters to match MIME email format. Disable for compact single-line output suitable for JSON or data URLs.
Everything you need to know about Base64
Your data never leaves your browser
Your data never leaves your browser. This Base64 encoder/decoder operates entirely client-side using JavaScript's native btoa() (encode) and atob() (decode) functions built into your web browser. There are no server uploads, no backend processing, and no data transmission to any external services.
This makes the tool safe for encoding sensitive data like API keys, authentication tokens, private documents, confidential files, or any proprietary data. Use with confidence for production debugging, file uploads, or handling regulated data (HIPAA, GDPR, PCI-DSS).
Performance metrics and capabilities