Turn an image into a Base64 data URI you can paste straight into HTML or CSS.
Small images work best — Base64 adds about a third to the size
Processed on your device — nothing is uploaded
A small icon
Where embedding makes sense
icon.pngAn SVG logo
Often tiny once encoded
logo.svgA photo
See why embedding these is a bad idea
photo.jpgSmall files work best — the output grows by roughly a third.
With the data URI prefix for HTML and CSS, or raw Base64 for JSON and APIs.
Copy straight to the clipboard, or save the text as a file.
The data URI prefix is included by default, so the output drops straight into a src or a background-image.
The encoded size is displayed, which makes clear when embedding is helping and when it is bloating your page.
Encoding runs without freezing the page, and the tool warns when the output is large enough to be a poor idea.
Encode an image as Base64 text, with or without the data URI prefix, so it can be embedded directly in HTML, CSS or JSON instead of loaded as a separate file. That is genuinely useful for small icons where an extra network request costs more than the bytes, and a bad idea for large photographs, where Base64 adds about a third to the size. The tool shows the encoded length so the trade-off is visible before you commit.
Keep going
Related pages in Image Tools, plus what others are using right now.
More image tools that pair well with this one.
Paste Base64 image data and get a viewable, downloadable image back.
Encode text to Base64, including full Unicode and URL-safe output.
Convert between JPEG, PNG and WebP, with quality control and transparency handling.
Shrink JPEG, PNG and WebP files with a quality slider and a live size comparison.
Resize images by pixel dimensions or percentage, with the aspect ratio locked or free.
Turn a logo into favicon.ico, the PNG sizes a site needs, and the HTML to declare them.
Create strong random passwords with full control over length and characters.
Format, validate and minify JSON, with errors that point to the exact line.
Work out any percentage — of a number, as a share, or as a change.
Count words, characters, sentences and paragraphs as you type.
Convert between length, weight, temperature, volume, speed, data and more.
Count characters with and without spaces, against the limits that matter.
Find the mean, median, mode and range of a list of numbers, with the working shown.
Sample and population standard deviation and variance, both shown, with the working.
Check a downloaded file against its published checksum, without uploading anything.
Stamp text like DRAFT or CONFIDENTIAL across a PDF, in your browser.
Turn JSON into readable YAML, with quoting and multiline strings handled properly.
Escape text for HTML, or turn entities back into readable characters.