About Image & PDF Base64 Encoder / Decoder
Base64 encoding converts binary files — images, PDFs, and other assets — into a plain ASCII string that can be safely embedded in HTML, CSS, JSON, or transmitted over text-only channels. This tool handles the conversion entirely in your browser: no file is ever uploaded to a server.
Encode — Image or PDF to Base64
Select any image (PNG, JPG, GIF, WebP, SVG, BMP, AVIF) or PDF up to 10 MB. The tool reads it with the browser FileReader API and outputs either a ready-to-paste Data URI or a raw Base64 string.
- Data URI — includes the MIME prefix (
data:image/png;base64,…). Drop it straight into an HTMLsrcattribute or CSSurl(). - Raw Base64 — the encoded bytes only, without any prefix. Use this when the consuming API or format already knows the MIME type.
Decode — Base64 to Image or PDF
Paste a Base64 string — either a full Data URI or raw Base64 — and click Decode. The tool reconstructs the original binary, shows a live preview for images, and lets you download the restored file.
Common Use Cases
- Inline images in HTML/CSS — embed small icons or backgrounds without an extra HTTP request.
- API payloads — send file attachments as JSON strings when a binary endpoint is unavailable.
- Email attachments — MIME email encodes attachments in Base64 for safe transmission.
- Data URIs in CSS — bundle small assets into a stylesheet to reduce round trips.
- Debugging — inspect or recover a Base64 blob received from an API response.
Privacy
All processing happens locally in your browser using the Web FileReader and Blob APIs. Your files are never sent to any server.