Turn any image into Base64 and copy it as a data URI, a raw string, a CSS rule or an HTML tag.
Your files never leave this deviceFour steps, and it takes a couple of seconds.
Drag an image onto the box above, or click Browse to pick one from your device.
Latch reads the image and encodes it to a Base64 string, which works even offline.
Data URI, raw Base64, a CSS background-image rule, or an HTML <img> tag.
Hit Copy and paste the string straight into your stylesheet, markup or code.
A Base64 data URI encodes an image's bytes as plain text, so you can drop the picture straight into your HTML, CSS or JavaScript instead of linking to a separate file. It starts with something like data:image/png;base64, and is followed by the encoded data. Because the image travels inside your code, the browser doesn't make a separate network request for it.
Inlining works best for small assets such as icons, tiny logos or an inline SVG, where saving a round-trip matters more than bytes. Size is the downside. Base64 is about 33% larger than the original file, so large photos are usually better left as separate, cacheable files.
Switch the format toggle to grab exactly what you need: a raw string, a ready-made <img> tag, or a CSS background-image rule. Need to go the other way? Base64 to Image decodes a string back into a downloadable picture.
No. Your browser reads and encodes the image locally. Nothing is sent to a server, and the tool keeps working offline once the page has loaded.
A data URI encodes a file's bytes as text, so you can embed an image directly in your HTML, CSS or JavaScript instead of linking to a separate file. It looks like data:image/png;base64, followed by the encoded data.
Base64 represents 3 bytes of binary as 4 text characters, so the encoded string is about 33% larger than the original file. You pay that extra size whenever you embed an image inline, so it suits small images like icons. Large photos are usually better left as separate files.
Any image your browser can read, including PNG, JPG, WebP, GIF, SVG, AVIF and BMP. The output keeps the original MIME type, so an SVG stays image/svg+xml and a PNG stays image/png.
Switch the format toggle to CSS for a background-image: url(...) rule, or to HTML for a ready-made <img> tag. Both paste straight into your code and render the image with no extra network request.