Convert an image into a Base64 data URI you can paste straight into your CSS or HTML β no separate file and no extra HTTP request. Drop an image, pick an output format and copy the result. 100% in your browser β your image never leaves your device.
Drop an image here or click to choose
PNG, JPG, GIF, WebP, SVG Β· processed locally
π Everything runs in your browser. Your image is never uploaded, logged or stored.
The Base64 Image Encoder turns an image into a Base64 data URI β a long text string you can paste directly into your CSS or HTML so the image travels inside your code instead of as a separate file. For small images such as icons and logos, this removes an extra HTTP request, which can make a page feel faster. The tool reads your image entirely in the browser, so it is private and instant.
It is part of the Performance & Code Tools group in our free SEO Toolkit, alongside the Image Size Estimator and Critical CSS Extractor. After embedding, tidy your code with the CSS Minifier or HTML Minifier, and check overall weight with the Page Size Calculator. Everything runs in your browser β your image never leaves your device.
Turn small images into ready-to-paste data URIs.
Drop an image or click to choose β PNG, JPG, GIF, WebP or SVG.
Get a raw data URI, a CSS background rule or an HTML img tag.
See the original size, encoded size and a warning for big files.
Your image is read locally and never uploaded anywhere.
From image to embeddable code in seconds.
Drop or choose a small image.
Data URI, CSS or HTML.
Review original vs encoded size.
Paste it into your project.
A tiny icon embedded as a CSS background.
.icon { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgβ¦'); }
A Base64 image is an image encoded as text using the Base64 scheme and written as a data URI β a string that begins with data:image and contains the whole image inline. Because the image lives inside your CSS or HTML, the browser does not need to make a separate request to fetch it. For small, frequently used images such as icons this can shave a request off the page load. This tool encodes any image into that format for you. It is part of the Performance & Code Tools group.
Base64 embedding is a trade-off, so it helps to know when it pays off. It is genuinely useful for tiny images, but it works against you for large ones, and being honest about that is part of using it well.
| Good fit | Poor fit |
|---|---|
| Small icons and logos (under ~10 KB) | Large photos and hero images |
| Images used in critical, above-the-fold CSS | Images reused across many pages |
| Single-use decorative graphics | Anything you want the browser to cache separately |
The reason is that Base64 encoding makes the data roughly a third larger than the original binary, and an inlined image cannot be cached on its own β it is re-downloaded with the CSS or HTML every time those change. For large or shared images, a normal image file, or a sprite, is usually faster.
The raw string, ready to use anywhere a URL is accepted.
A complete background-image rule you can drop into a stylesheet.
An img tag with the data URI as its source.
Copy or download the output in whichever format you pick.
Base64 represents binary data using a limited set of text characters, which costs about a third more space than the original. This is normal and expected. It is why Base64 suits small images, where the saving of one network request outweighs the extra bytes, but not large ones, where the bloat dominates.
Not on its own. Because the image is part of your CSS or HTML, it is cached only as part of that file and is re-downloaded whenever the file changes. A separate image file can be cached independently and reused across pages, which is often the better choice for anything but small, single-use graphics.
Indirectly and only in the right cases. Faster pages are better for users and for Core Web Vitals, and removing a request for a tiny critical icon can help. But over-using Base64 bloats your CSS and HTML and can slow rendering, so use it selectively. Note that an inlined image has no separate URL for image search to index.
No. The image is read directly in your browser using the FileReader interface and converted locally. Nothing is uploaded, logged or stored, so the tool is safe for unreleased artwork, client assets and confidential graphics.
Inline small UI icons to save requests.
Embed tiny above-the-fold graphics.
Include small images in HTML email where allowed.
Bundle images into one self-contained file.
Use the Base64 Image Encoder with these tools from the SEO Toolkit: estimate image weight with the Image Size Estimator, extract above-the-fold styles with the Critical CSS Extractor, shrink stylesheets with the CSS Minifier, compress markup with the HTML Minifier, check total weight with the Page Size Calculator, and build head tags with the Meta Tag Generator.
Anyone embedding images in code or email.
Everything about Base64 image encoding.
It converts an image into a Base64 data URI β a text string containing the whole image β that you can paste directly into your CSS or HTML. You add an image, pick a format such as a raw data URI, a CSS background rule or an HTML img tag, and copy the result.
Yes, completely. There is no cost, no sign-up and no limit on how many images you encode. The tool runs entirely in your browser, so there are no server costs and nothing to pay for.
No. The image is read directly in your browser using the FileReader interface and converted locally. Nothing is uploaded, logged or stored, which makes the tool safe for unreleased artwork, client assets and confidential graphics.
Use it for small images such as icons and logos, ideally under about 10 KB, especially in critical above-the-fold CSS, where saving one network request helps. Avoid it for large photos or images reused across pages, where the size overhead and lack of separate caching slow things down.
Base64 represents binary data with a limited set of text characters, which adds roughly a third to the size. This is normal. It is why the technique suits small images, where removing a request outweighs the extra bytes, but not large ones, where the bloat dominates.
Not by itself. Because it lives inside your CSS or HTML, it is cached only as part of that file and re-downloaded whenever the file changes. A separate image file can be cached on its own and reused across pages, which is usually better for anything but small graphics.
Common web image types work, including PNG, JPG, GIF, WebP and SVG. The tool preserves the original format inside the data URI, so a PNG stays a PNG and a JPG stays a JPG. The encoded output simply wraps that same image data as text.
Only indirectly and selectively. Faster pages help users and Core Web Vitals, and inlining a tiny critical icon can remove a request. But over-using it bloats your code and an inlined image has no separate URL for image search to index, so use it sparingly and for the right images.
Three: a raw data URI you can use anywhere a URL is accepted, a ready-made CSS background-image rule, and an HTML img tag with the data URI as its source. You can switch between them instantly and copy or download whichever you need.
Yes. As well as copying the output to your clipboard, you can download it as a plain text file. This is handy when the data URI is long and you want to keep it in a file rather than paste it immediately.
Yes. The encoder is fully responsive, so you can convert images from a phone or tablet. Choosing an image, switching output formats, reading the size details and copying the result all work the same as on desktop.
Convert, compress, and resize images in multiple formats β JPG, PNG, WebP, ICO, and more.
Calculate in-hand salary, CTC breakup, tax deductions, and more for Indian employees.
Convert length, weight, temperature, speed, volume, and 200+ measurement units instantly.
Count words, convert case, generate lorem ipsum, find & replace text, and more writing utilities.
Turn a small image into an embeddable data URI for your CSS or HTML in seconds β free, private and instant in your browser.
πΌοΈ Open the Encoder β All Performance Tools