Image to Base64
Convert an image to a Base64 string or data URI online — with raw, CSS and HTML output and one-tap copy. Free, fast and 100% private in your browser.
or drop a JPG, PNG, WEBP, GIF or SVG here
Processed in your browser — your images never leave your device.
More tools
Inline your images directly into code. oMyImage's Image to Base64 tool encodes any image into a Base64 data URI right in your browser, and gives you the raw string, a CSS background rule and a ready-made <img> tag too. Perfect for embedding small icons and logos without an extra HTTP request. Nothing is uploaded, so your image stays private.
How to convert an image to Base64
- 1
Upload
Select an image, or drag and drop it into the workspace.
- 2
Choose the format
Switch between a data URI, raw Base64, a CSS background rule or an <img> tag.
- 3
Copy or download
Copy the string to your clipboard or download it as a .txt file.
Image to Base64 features
Four output formats
Get a ready-to-use data URI, the raw Base64, a CSS background-image rule, or a complete <img> tag.
Instant encoding
Encoding happens the moment you drop the file — no waiting, no upload.
100% private
Your image is encoded in your browser and never sent to a server.
Security & privacy
Your image stays private. Base64 encoding happens entirely in your browser — nothing is uploaded to a server. No storage, no tracking of your files.
Frequently asked questions
What is a Base64 data URI?
It's a text representation of your image you can embed directly in HTML or CSS, avoiding a separate file request.
Why is the string larger than my file?
Base64 encoding adds about 33% overhead, so it's best suited to small images like icons and logos.
Which formats are supported?
JPG, PNG, WEBP, GIF, BMP, SVG and AVIF.
Is it free and private?
Yes. No sign-up, and the image is encoded locally in your browser — nothing is uploaded.