Convert any image to a Base64 data URI and copy it as ready-to-use CSS, an HTML img tag or raw Base64. Everything runs in your browser.
Base64 turns the bytes of an image into plain text. Wrapped as a data URI (data:image/png;base64,…) it can be placed straight into HTML, CSS, JSON or an email, so the browser does not need a separate request to load the file. This tool reads your image locally and gives you the finished string.
HTML: <img src="data:image/png;base64,…" alt="">. CSS: background-image: url('data:image/png;base64,…');. Use the Raw Base64 tab when an API asks only for the encoded string without the data: prefix.
No. The conversion runs entirely in your browser using the FileReader API. Your image never leaves your device.
Base64 represents every 3 bytes of data as 4 text characters, so the output is always about one third larger. That is why it is best for small images.
A data URI includes the prefix data:image/png;base64, that tells the browser the file type. Raw Base64 is only the encoded characters. Use the data URI for HTML and CSS, raw Base64 for APIs and databases.
JPG/JPEG, PNG, GIF, WebP, SVG, ICO, AVIF and BMP. The MIME type is detected from the file, or from the file extension when the browser does not report one.
For very large images the on-screen preview is shortened to keep the page fast. The Copy and Download buttons always give you the complete text.
Yes — paste the data URI into your browser's address bar to view it, or use the Base64 Encoder / Decoder to decode the raw string and download it as a file.