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.
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
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.Base64 EncoderEncode text or files to Base64.
Ready to use Image to Base64?
Image to Base64