Image to Base64
Encode an image as a Base64 data URI, with ready-to-paste CSS and HTML snippets.
Processed entirely in your browser. Your image is never uploaded to a server.
- Four output shapes: data URI, raw Base64, CSS rule, <img> tag.
- Shows the decoded size and the text size so you can judge the trade-off.
- Works with PNG, JPG, WebP, GIF, SVG and ICO.
- Runs in your browser — the image is never uploaded.
Why this is private
- Processed entirely in your browser. Your image is never uploaded to a server.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Turn an image file into a Base64 string you can inline directly in CSS, HTML or JSON — no separate file, no extra request. Get the full data URI, the raw Base64, a CSS background-image rule or an <img> tag, and copy or download any of them. Everything is encoded locally in your browser.
How to use it
- 1Add an image (small icons and logos work best).
- 2Pick the output shape.
- 3Copy it, or download it as a .txt file.
Frequently asked questions
What people use it for
Inline a small icon in CSSEmbed a tiny sprite or bullet as a data URI so it costs no extra HTTP request.
Ship a logo inside a single-file HTML exportPut the image in the markup itself for an email template or a standalone page.
Put an image in a JSON payload or configEncode a small asset as Base64 to pass it through an API or store it as a string.
Related guides
- How to resize a photo and signature for online formsApplication portals want the photo and signature at exact pixel sizes and tiny file sizes. Here's how to hit both without an app.
- How to compress images for the web without them looking badWhy images make pages slow, how much quality you can drop before anyone notices, and a repeatable way to hit a size target.
- How to resize an image without losing qualityWhat 'without losing quality' really means when you resize, why enlarging is different from shrinking, and how to keep proportions intact.
- JPG, PNG or WebP: which image format should you use?A practical guide to picking an image format — what each one is good and bad at, and when to convert.
Related tools
All image toolsBase64 to ImageDecode a Base64 string or data URI back into a viewable, downloadable image.Image ConverterConvert images between JPG, PNG, WebP and AVIF — in batches, with quality control.Data URI GeneratorConvert a file into a data: URI for embedding in HTML or CSS, with a smaller URL-encoded mode for SVG.Base64 EncoderEncode text to standard or URL-safe Base64.
Ready to use Image to Base64?
Image to Base64