Base64 Encoder & Decoder
Encode plain text or files to Base64, or decode Base64 strings back to their original content. All processing happens in your browser — your data never leaves your device.
Encode a File to Base64
Upload any file to get its Base64 representation. This is useful for embedding small images directly in CSS or HTML, or for transmitting binary data in text-based formats like JSON.
What Is Base64 and Why Use It?
Base64 is an encoding scheme that converts binary data into a text string using 64 printable ASCII characters. It is not encryption — anyone can decode Base64 back to the original content — but it is invaluable for transferring binary data through systems that only handle text.
Common Use Cases
Embedding images in HTML or CSS: Small icons and graphics can be converted to Base64 data URIs and embedded directly in your stylesheet or markup, eliminating extra HTTP requests. This is especially useful for single-file emails or critical above-the-fold assets.
APIs and JSON: JSON does not natively support binary data. If you need to send an image or a file through a REST API, encoding it as Base64 inside a JSON string is the standard approach.
Data URLs: Modern browsers support data URIs like data:image/png;base64,iVBORw0KGgo... which let you display images without hosting them on a server. Our file encoder generates these strings for you automatically.
Debugging and inspection: Developers often encounter Base64 strings in configuration files, JWT tokens, cookie values, and network payloads. Being able to quickly decode them to inspect their contents is a daily necessity.
URL-Safe Base64
Standard Base64 uses the characters + and /, which have special meanings in URLs. URL-safe Base64 replaces + with - and / with _, and sometimes omits padding = characters. This makes the encoded string safe to pass as a query parameter or path segment without further encoding. If you are generating Base64 for use in a web address, enable the URL-safe option.
How to Use This Tool
Paste your text into the input box and click Encode to Base64 to convert it. To reverse the process, paste a Base64 string and click Decode from Base64. Use the Swap button to move the output back to the input for chained operations. Enable URL-safe Base64 if you plan to use the result in a URL. To encode a file, use the file picker below the text areas — the tool will read the file locally and output its Base64 representation, complete with the data URI prefix.