What is a Base64 image string?
A Base64 image is a text representation of binary image data, commonly used to embed images directly in HTML, CSS, or JSON without linking to a file.
Convert images to Base64 strings or data URLs online. Upload PNG, JPG, or SVG and copy the encoded string for use in HTML, CSS, and code.
If this tool isn’t working as expected, please take a screenshot of the error and report the problem here so we can investigate and improve it.
Base64 embedding eliminates the HTTP request for small images - useful for icons, placeholders, and email HTML where external image requests are blocked by default. The trade-off: Base64 increases file size by ~33%, so it's best reserved for small images under 5KB.
Upload any image and get a Base64 encoded string you can paste directly into HTML img src attributes, CSS background-image properties, or JSON payloads - embedding the image without a separate server request.
Select a PNG, JPG, GIF, SVG, or WebP file to encode.
The tool reads the file and generates the Base64 string instantly.
Copy the raw Base64 string or the full data URL for HTML embedding.
Verify the encoded image matches your original upload.
Embed small icons in CSS without a separate image file.
Include images in email HTML templates where external image requests are blocked.
Embed images in JSON API payloads.
Create self-contained HTML files with embedded assets.
Test image display in environments without file server access.
Generate data URLs for Markdown editors that accept inline images.
Best For
Uploaded File
A 1×1 pixel PNG (68 bytes)Data URL
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=The Data URL always follows this structure: data: + the file's MIME type (auto-detected from the upload) + ;base64, + the encoded data. Even this tiny 68-byte PNG produces a 92-character Base64 string - close to the ~33% size increase this encoding typically adds.
Data URL
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=Base64 String Only
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=The "Base64 String Only" button copies everything after the comma - just the encoded data, without the data:image/png;base64, prefix. Use the full Data URL for an img src or CSS url(); use the string alone if you're building the data: prefix yourself.
Copied Data URL
data:image/png;base64,iVBORw0KGgo... (copied from the Data URL field)CSS
background-image: url("data:image/png;base64,iVBORw0KGgo...");There's no dedicated CSS copy button - paste the Data URL you already copied inside a url("...") wrapper yourself. The tool only provides one-click copies for the raw Data URL, the Base64 string alone, and an HTML img tag.
Skip a separate image request for a small icon by pasting its Data URL into a CSS url() declaration.
Encode a logo or icon as Base64 so it displays even when the email client blocks external image requests by default.
Use the Base64 String Only output as a JSON string value when an API expects image data embedded in the request body rather than as a separate file upload.
Use the live preview to visually confirm the encoded string round-trips correctly before pasting it somewhere else.
Problem
Solution
There are only three copy options - Data URL, Base64 String Only, and an HTML img tag. Using the string in CSS (background-image: url(...)) or JSON means wrapping the copied value yourself.
Problem
Solution
Base64 encoding adds roughly a third to the file size and can't be cached separately from the page - it helps small icons avoid an extra request, but it works against you on large images.
Problem
Solution
The tool doesn't enforce a maximum file size - encoding a very large image will still work, but the resulting string (and your browser tab) may become sluggish to handle.
Problem
Solution
This tool only encodes image files into Base64 - it doesn't accept a Base64 string and convert it back into an image file.
Since Base64 adds about 33% to the file size, compressing a larger image first keeps the resulting string smaller and more practical to embed.
If you need to construct the data: prefix yourself - for example, to override the detected MIME type - copy the Base64 String Only output rather than the full Data URL.
The tool renders the uploaded image back from its own encoded string - if the preview looks right, the encoding round-trips correctly for wherever you paste it next.
The tool only encodes image files into Base64 - it doesn't decode a Base64 string back into a downloadable image file.
There's no maximum file size built in, so very large uploads are accepted but can produce unwieldy strings and slow the browser tab down.
The file is encoded exactly as uploaded - the tool doesn't resize, compress, or convert it to a different image format before encoding.
Data URL, Base64 String Only, and an HTML img tag are the only one-click copy options - there's no dedicated CSS url() or JSON-wrapped output.
Both display the same image - the difference is where the data lives and how the browser handles it.
| Base64-Embedded (this tool's output) | Regular Image File (linked by URL) | |
|---|---|---|
| HTTP request | None - the image data is inline | One separate request per image |
| Caching | Cached only as part of the parent HTML/CSS file | Cached independently by the browser |
| File size impact | ~33% larger than the original binary | Original file size, unchanged |
| Best for | Small icons, email HTML, self-contained files | Larger images, anything reused across multiple pages |
Which should you use?
Base64 wins when avoiding a request matters more than caching - small icons, one-off assets, and email HTML. A regular file wins for anything larger or reused across pages, since the browser can cache it once instead of re-downloading it inside every page that embeds it.
The most common question is whether Base64 images load slower. They load faster on the first request (one less HTTP round-trip) but increase the HTML/CSS file size, which slows the initial parse. The trade-off favors Base64 for small icons and against it for large images.
A Base64 image is a text representation of binary image data, commonly used to embed images directly in HTML, CSS, or JSON without linking to a file.
Use it as an img src: <img src="data:image/png;base64,..." />. This embeds the image directly in your HTML without a separate file request.
Base64 strings are about 33% larger than the original file. For large images this can slow page loads, so it is best used for small icons and logos.
Leave your email so we can prioritize similar tools and updates.
Trending tools will appear as visitors explore the catalog.
Your recently visited tools will show up here.