Base64 Encoder & Decoder
Encode text or any file to Base64, generate data URIs, and decode Base64 back to images, text, or downloadable files — 100% private, nothing uploaded.
Encoded Output
Type text on the left and the Base64 output appears here.
Your data is never uploaded — everything runs in your browser.
What Can You Do With This Tool?
Embed Images in CSS & HTML
Drop an image into the encoder, copy the data URI output, and paste it directly into your CSS background-image or HTML <img src>. No external file reference needed — the image data lives inside your code.
Encode API Payloads & Files
Many APIs require binary data (PDFs, signatures, certificates) to be Base64-encoded before sending in JSON. Drop the file, copy the Raw Base64, and paste it into your request body.
URL-Safe Base64 for JWTs & Query Strings
Standard Base64 uses + and / characters that break URLs. Toggle URL-safe mode to get a - and _ variant with no = padding — the format used in JWT tokens, OAuth state parameters, and URL query values.
Decode & Preview Data URIs
Paste a data URI from a CSS file or network request and instantly preview the embedded image, read back the text, or download the binary file — without writing a single line of code.
Frequently Asked Questions
What is Base64 encoding?
Base64 encodes arbitrary binary data (bytes) as a sequence of printable ASCII characters. It uses 64 characters — A–Z, a–z, 0–9, + and / — plus = for padding. Each 3 bytes of input becomes 4 Base64 characters, so the encoded size is roughly 33% larger than the original. It is used wherever binary data must travel through text-only channels: email attachments (MIME), JSON API bodies, HTML data URIs, and cryptographic tokens.
What is URL-safe Base64?
URL-safe Base64 replaces + with - and / with _ so the encoded string can be used in URLs and query strings without percent-encoding. It also omits the = padding characters. JWT tokens, OAuth state parameters, and Firebase storage URLs all use URL-safe Base64.
What is a data URI?
A data URI embeds file content directly in a URL using the format data:mime/type;base64,<encoded-data>. Browsers and email clients can render images referenced as data URIs without a separate HTTP request. They are commonly used for small icons in CSS and HTML, email inline images, and offline-capable web apps.
Is my file uploaded to a server when I encode it?
No. The encoder runs entirely in your browser using the FileReader API and JavaScript — no network request is ever made. Your file is read into local browser memory, converted to Base64, and displayed to you. Nothing leaves your device.
What is the file size limit?
The encoder accepts files up to 10 MB. Larger files are technically encodable but the resulting Base64 string would be several megabytes of text, which is impractical to paste into most code or API clients. If you need to encode larger files, a command-line tool like base64 (macOS/Linux) or certutil (Windows) will be more suitable.
How does the decoder detect what type of data is inside?
The decoder reads the first few bytes of the decoded binary and compares them against known file signatures (magic bytes). For example, PNG files start with 0x89 0x50 0x4E 0x47. If the bytes contain no null characters and fewer than 10% control characters, the data is treated as text. If a data URI prefix (data:mime;base64,…) is present, that MIME type takes priority over magic-byte detection.
More Productivity Tools
Explore our other privacy-focused tools designed to boost your productivity
JSON Formatter & Validator
Format, validate, and explore JSON & XML in your browser — tree view, table view, sort keys, no uploads
CSV Tools
Convert CSV to JSON, SQL, or a live table preview — and JSON arrays back to CSV. Auto-detects delimiter, no uploads
Last Time I Did This↗ Android
Track recurring tasks and habits on Android