We use essential cookies to keep you signed in and protect forms. We also use analytics to count visits and see how pages are used. Ads on our free tools may set cookies to show and measure ads. Cookie notice
Image to Base64
Embed a small picture straight into HTML, CSS or an email template. The image is read on your device, not uploaded.
Your files stay with you. Your files never leave your browser. This tool runs on your device: nothing is uploaded to our servers, so there is nothing for us to store or see.
How to use it
1Choose the image.
2Pick the output you need: data URI, plain Base64, HTML tag or CSS.
3Copy it or download it as a text file.
Where it helps
HTML emails
Embed a small logo so it shows without loading external images.
CSS and HTML
Inline tiny icons to save separate file requests.
JSON and APIs
Send a small image inside a text payload.
Good to know
Private by design
Pictures are processed in your browser and never uploaded to our servers.
Not for large photos
Big strings slow pages and can't be cached separately.
Compress first
Shrink the image before encoding to keep the string short.
Data URI format
data:image/png;base64, followed by the encoded text.
Choose the image and pick the output you need: a data URI, plain Base64, an HTML img tag or CSS background code. Copy it or download it as a text file. Base64 is about a third larger than the image, so use it only for small icons and logos. The image is read in your browser, not uploaded.
4 outputsData URI, Base64, HTML, CSS.Copy or download.
+33%Size.Text is larger than the file.
< 10 KBBest use.Small icons and logos.
0Uploads.On your device.
How do I convert an image to Base64?
Choose the image, then pick the output you need: a data URI, plain Base64 text, an HTML img tag or CSS background code. Copy the result to your clipboard or download it as a text file. The image is read in your browser and isn't uploaded anywhere.
What is a Base64 image good for?
It lets you put a picture inside your code, so the page or email needs no separate file request. It suits tiny icons and logos in HTML emails, CSS files or JSON payloads, where linking to an external image file is inconvenient or unreliable. It keeps things self-contained.
Why is the text longer than the file?
Base64 turns every three bytes of the image into four characters of text, so the encoded string is about one third bigger than the original file. That overhead is why Base64 is best kept for small images rather than photos. Compress the image first to keep strings short.
Should I use Base64 for large photos?
No. Large Base64 strings slow the page down and can't be cached on their own, so they're downloaded again with every page. Use Base64 for images under about 10 KB, and compress the picture first. Link large images as normal files. Lazy loading also helps.
Is the picture uploaded?
No. It's read and encoded in your browser on your device. That means you can safely encode internal logos or images for private projects. After the page loads, the tool even works without an internet connection. Nothing is stored afterwards, and there's no account to create.
What is a data URI?
A data URI is a string that starts with data:image/png;base64, followed by the encoded image. Browsers treat it like an image address, so you can use it in an img tag's src or a CSS url(). It includes the image type, so the browser knows how to read it.
Do Base64 images work in emails?
They work in many email apps but not all; some, including several webmail services, block or strip embedded data URIs. Test your email in the apps your customers use. For important images, hosting them and linking is usually more reliable. Test before a big send.
How do I use the HTML output?
Copy the img tag and paste it into your HTML where the image should appear. It already contains the data URI in its src attribute. Add alt text describing the image, so screen readers and search engines understand it. Set width and height too, so the layout doesn't jump.
How do I use the CSS output?
Paste the CSS into your stylesheet. It sets the image as a background using url() with the data URI inside. This suits small decorative icons. Avoid it for large images, because the whole stylesheet becomes heavier to download. Check your stylesheet stays small. Test it in your browser.
Can I decode Base64 back into an image?
This tool encodes images. To decode a Base64 string, paste the data URI into a browser's address bar to view it, or use a developer tool. The Base64 encode/decode tool handles text, which is useful for other kinds of encoded data. That covers most needs.
Which image formats work?
Common formats such as PNG, JPG, WebP, GIF and SVG images your browser can read. PNG and SVG suit icons and logos best. The output includes the correct image type in the data URI, so it displays properly wherever you paste it. SVG often encodes smallest.
Does Base64 affect SEO?
Inline Base64 images can't be indexed as separate images by search engines, and they add weight to the page's HTML. For product photos and content images that should appear in image search, use normal image files with descriptive file names and alt text. Inline only tiny decorations.
How small should the image be?
Ideally under about 10 KB. Icons, small logos and simple graphics fit easily. Compress the image and reduce its dimensions first, so the encoded string stays short and doesn't slow your page or email down noticeably. A 32 x 32 icon is usually well under that limit.
Does it work on a phone?
Yes, in modern mobile browsers. Choose the image, pick the output and copy it. Copying long strings on a phone can be awkward, so downloading the text file is often easier, then opening it on your computer to paste into code. Nothing is uploaded. No app needed.
Is it free?
Yes. Image to Base64 is free, with no sign-up and no limit. It's one of several free developer and image tools from Marketiism that run in your browser, alongside Base64 encode/decode, JSON formatter and favicon generator. Nothing is added to your output, and it works for business projects too.
Want this inside your own account?
Marketiism keeps your invoice numbers, GST reports, UPI payment links and WhatsApp reminders in one place. Leave your details and we'll call to set it up for your business, or start the trial yourself.