Image · Data URIs

Image ↔ Base64

Inline an image, or decode one back out

Produce a data URI ready to paste into CSS or HTML, or paste a Base64 blob and get the file back.

Data URIDecodeCSS snippetSize warning
Max inline
2 MB
Overhead
+33%
Uploaded
0 B

Image ↔ Base64

Runs in your browser · nothing uploaded
Image
Data URI out
Bytes in
0
Bytes out
0
Overhead
—
Type
—

01 — How to use Image ↔ Base64

1 Choose an image PNG, JPEG, WebP, GIF, AVIF or SVG, up to 2 MB. The file is read in this tab — it is never uploaded.
2 Copy the data URI The output is a complete data: URI. Ready-made CSS and HTML snippets sit below it, so you can paste straight into a stylesheet or a template.
3 Or decode instead Switch to Decode and paste a data URI or a bare Base64 blob. The format is read from the declaration, or sniffed from the bytes when there is none.
4 Download the decoded file Decoding gives you the original image back with the right file extension, saved straight to your machine.

02 — Getting good results

Inline small images only A data URI is parsed on every page load and cannot be cached separately from the document that contains it. Icons and tiny textures are worth inlining; a hero photograph is not, which is why the cap here is 2 MB rather than the 50 MB other tools allow.
Budget for the third that Base64 adds Encoding grows a file by about 33% before any line wrapping. A 900 KB image becomes roughly 1.2 MB of text in your stylesheet, and that text is on the critical path for rendering.
SVG often does not need encoding at all SVG is already text. A URL-encoded SVG data URI is usually smaller than a Base64 one and stays readable, so reach for Base64 only when the markup contains characters that are awkward to escape.

03 — Questions

No. The file is read with the browser's own file API and encoded in this tab. Nothing is transmitted, which is the point when the image is a client logo or an unreleased asset.

04 — More about Image ↔ Base64

61 more tools
where this came from.

Same shell, same shortcuts, same promise: nothing leaves your browser.

Browse all 62