Convert text, images and files to Base64 โ or decode Base64 back to readable content. Fast, private, no signup.
Drop image or file here to encode
or click to browse โ PNG, JPG, PDF, TXT and moreMost Base64 tools only handle plain text. Ours supports images, binary files, and real-time preview โ all in your browser.
Upload any image and get its Base64 data URI โ ready to embed in HTML or CSS.
Encode PDFs, text files, and more. Drag and drop any file directly onto the tool.
When you decode an image Base64 string, it renders as a visual preview instantly.
All encoding and decoding happens in your browser. Nothing is ever uploaded.
Built for developers, designers, and anyone who works with data encoding daily.
Results appear the moment you click. No server round-trips, no waiting. Pure browser-side speed.
Upload any image and get a complete data URI you can drop directly into your HTML or CSS stylesheet.
Encode any text or file to Base64. Decode any Base64 string back to readable text or image preview.
Copy your encoded or decoded output to clipboard with a single button. Paste it anywhere instantly.
Fully responsive for mobile, tablet, and desktop. Same smooth experience on every screen size.
Your text and files never leave your browser. No logs, no analytics on your content, no tracking.
From developers to content creators โ Base64 encoding solves real problems across many fields.
Embed small images directly in CSS or HTML as data URIs to eliminate extra HTTP requests and speed up pages.
Encode images and attachments for email templates where external image links are often blocked by clients.
Encode binary payloads for JSON APIs, transmit files over text-based protocols, and handle auth tokens.
Quickly generate inline SVG or image data URIs for design prototypes without needing separate asset files.
Analyze Base64-encoded payloads in HTTP headers, JWT tokens, and encoded scripts during security audits.
Understand how Base64 encoding works hands-on โ encode a string and instantly see the encoded output.
Everything you need to know about Base64 encoding and decoding.
If you have worked with web development, APIs, or data transmission, you have almost certainly encountered Base64 encoding. It is one of the most widely used encoding schemes on the internet โ and yet many people do not fully understand what it is, why it exists, or how to use it effectively.
This guide covers everything: what Base64 is, how it works, when to use it, and how Toolyfi's free Base64 encoder and decoder tool makes the process instant and effortless.
Base64 is a binary-to-text encoding scheme. It converts binary data โ bytes that may include any value from 0 to 255 โ into a string of printable ASCII characters. The "64" in Base64 refers to the 64 characters used: AโZ, aโz, 0โ9, plus (+), and slash (/).
The reason Base64 exists is simple: many text-based systems cannot handle raw binary data. Email protocols, HTTP headers, JSON payloads, and XML files were all designed to carry text. When you need to include binary content โ like an image, a PDF, or a compiled file โ in one of these systems, you need to first convert it to text. That is exactly what Base64 does.
๐ก Base64 is encoding, not encryption. It is easily reversible. Never use it to protect sensitive data.
The encoding process works by taking three bytes (24 bits) of binary data at a time and converting them into four Base64 characters (each representing 6 bits). Here is the step-by-step process:
For example, the text "Hi" in ASCII is 72 and 105 in decimal, or 01001000 01101001 in binary. Adding a zero byte for padding gives us 010010 000110 100100 000000, which maps to S, G, k, A โ making "SGkA" in Base64 (with one padding = sign).
One of the most practical uses of Base64 for web developers is embedding small images directly in HTML or CSS as data URIs. Instead of linking to an external image file, you encode the image as Base64 and include it inline:
This eliminates an HTTP request for the image, which can improve page load speed โ especially for small icons, logos, and UI elements. However, Base64 images are about 33% larger than their binary counterparts, so this technique is best reserved for small images (under 10KB).
SMTP โ the protocol that powers email โ was originally designed for 7-bit ASCII text. Binary attachments like PDFs, images, and Word documents cannot be sent directly. The MIME standard uses Base64 to encode these attachments into ASCII text for transmission. Your email client automatically decodes them on the receiving end.
JSON and XML are text formats. When an API needs to return binary data โ like a generated PDF, a thumbnail, or audio data โ the server typically encodes it as Base64 and includes it in the JSON response. The client decodes it to get the original binary file.
If you have ever worked with authentication tokens in modern web apps, you have used Base64 without knowing it. JWT tokens are three Base64URL-encoded parts separated by dots: the header, payload, and signature. You can paste any JWT into our decoder to read the header and payload contents.
Some database systems store binary blobs as Base64 strings in text columns. This simplifies queries and avoids binary data handling issues in certain ORMs and database drivers.
Standard Base64 uses + and / characters. These have special meaning in URLs, which causes problems when Base64 strings appear in query parameters or path segments.
Base64URL solves this by replacing + with - and / with _. It also omits the padding = signs. JWT tokens use Base64URL encoding for this reason.
Our tool uses standard Base64 encoding. If you need Base64URL, simply replace + with - and / with _ in the output, and remove any = padding characters.
data:image/png;base64,...๐ก For CSS use: background-image: url('data:image/png;base64,...');
We take privacy seriously. Toolyfi's Base64 encoder and decoder runs entirely in your browser using JavaScript's built-in btoa() and atob() functions, plus the FileReader API for file uploads.
No data is ever transmitted to any server. Your text, your files, and your images stay completely on your device. This makes our tool safe for encoding sensitive content like API keys, configuration files, and internal documents.
Base64 encoding is a foundational skill for anyone working in web development, backend engineering, or API integration. Whether you need to embed an image in CSS, debug a JWT token, or encode a file for API transmission, Toolyfi's free Base64 encoder and decoder gets the job done instantly โ with no signup, no limits, and complete privacy.
Try it now โ paste any text or upload any file above and see the Base64 result in milliseconds.
Toolyfi has tools for developers, writers, designers and everyone in between. All free, no signup.
๐ ๏ธ Explore All Tools