Image to HTML
Free image to HTML converter: turn JPG, PNG, WebP into self-contained HTML—base64 data URI, copy to clipboard or download .html file.
Or try an example
src or CSS background-image.Help Us Improve
—
(—)
Free image to URL converter: turn a picture into a base64 data URI for HTML img src or CSS background—copy the image link string in your browser.
Raw data URI
Copy data:image/…;base64,… for any paste target.
HTML image tag
One-click <img src="…"> for email HTML and static pages.
CSS background
Ready-made background-image: url("…") rule.
Original file bytes
Uses FileReader—keeps the source format, including animated GIF.
Size readout
See file size and approximate data URI payload size.
Private conversion
No server upload; everything stays on your device.
Upload a picture
Drop JPG, PNG, WebP, GIF, or another image (15 MB max).
Pick the output format
Choose raw Data URI, HTML <img>, or CSS background.
Copy the result
Click Copy and paste into your HTML, CSS, or email template.
Keep files small
Data URIs work best under a few KB—compress icons before embedding.
HTML vs CSS caching
URIs in HTML are not cached like separate images; CSS reuse can still help within one stylesheet.
Prefer sprites for many icons
Dozens of data URIs bloat CSS—consider a sprite sheet or icon font instead.
Need a full page?
Use /image-to-html to download a complete HTML document with the image embedded.
Check MIME in the prefix
The data:image/png;base64, (or jpeg/gif/webp) prefix should match your file type.
Email clients vary
Some clients block or truncate huge data URIs—test signatures before sending.
Ezgif.com Image to Data URI
Popular data URI converter with HTML/CSS options. Requires server upload.
Image hosting “get link” sites
Upload to a CDN for an https URL—different goal than embedding base64.
Browser DevTools
Can copy image as data URI manually, but slower than a dedicated paste-ready tool.
Image to HTML tools
Focus on full HTML documents; may re-encode via canvas instead of original bytes.
Image to Data URI (this tool)
Browser-only image to URL / data URI converter with raw, HTML, and CSS outputs—no upload.
Self-contained HTML emails: Embed small logos in signatures without external image hosting.
Single-file demos: Ship a prototype page with icons inline—no asset folder required.
CSS icon snippets: Paste tiny PNG/SVG-as-raster icons into background-image rules.
Docs and gists: Include screenshots in Markdown/HTML samples that travel as one blob.
Offline UIs: Keep critical images available when network requests are blocked.
Quick “image link” for code: Generate a pasteable image URL string without opening DevTools.
Instant
Encode as soon as the file loads—no queue or wait.
Three output shapes
Raw, HTML, and CSS cover the usual paste targets.
Private
Images are not uploaded to convert.
Free
Unlimited copies without watermarks or accounts.
Format-faithful
Original MIME type and bytes, including GIF animation.
Works with the HTML tool
Use /image-to-html when you need a full downloadable HTML document.
“Data URLs, URLs prefixed with the data: scheme, allow content creators to embed small files inline in documents.”
Data URLs: This tool generates data: URLs so images can be embedded inline without separate HTTP requests for the asset file. developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs
“The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer.”
FileReader API: Conversion uses FileReader.readAsDataURL so encoding happens entirely in the browser from the selected file. developer.mozilla.org/en-US/docs/Web/API/FileReader
“The HTML img element embeds an image into the document.”
HTML img element: The HTML output mode places the data URI in the img src attribute for self-contained markup. developer.mozilla.org/en-US/docs/Web/HTML/Element/img
“The background-image CSS property sets one or more background images on an element.”
CSS background-image: The CSS output mode wraps the data URI for use as a background-image value. developer.mozilla.org/en-US/docs/Web/CSS/background-image