BASE64 ENCODER
☞ runs entirely in your browser — nothing is uploadedDrop your image here
or click to browse — JPG, PNG, WebP
Preview
BASE64 ENCODER
Upload a JPG, PNG, or WebP and get a Base64 string or Data URL instantly. Copy to clipboard with one click.
or click to browse — JPG, PNG, WebP
Preview
embed images in code
Base64 rewrites binary data as ASCII text so an image can live inside HTML, CSS, JSON or an email template with no separate file to fetch. The cost is size: three bytes become four characters, so the encoded string is about a third larger than the file it came from, before the data URL prefix.
That trade is worth it for a handful of small assets — an icon, a 1×1 spacer, a logo in an email where remote images are blocked by default. It is a bad trade for anything large, because an inlined image cannot be cached separately, cannot be lazy-loaded, and has to be re-downloaded with every copy of the document that carries it.
three steps
Drop or select a JPG, PNG or WebP. The file is read with FileReader in the browser — nothing is sent anywhere, which matters when the image is a signature or an internal screenshot.
The full data URL carries its own MIME type and goes straight into markup. The raw Base64 payload is the same bytes without the prefix, which is what most JSON APIs and mail libraries expect.
Into an img src, a CSS url(), or a request body. Compress or resize the image first if the string looks alarming — the encoding cannot make a large file small.
quick answers
A data URL wraps the Base64 payload with a MIME prefix such as data:image/png;base64, so a browser can render it directly from the markup instead of requesting a file.
About 33% larger, because every three bytes become four ASCII characters. Gzip on the wire recovers part of that but not all of it, since Base64 output compresses worse than the binary it encodes.
When it is more than a few kilobytes, when it appears on more than one page, or when it is below the fold. An inlined image is re-sent with every copy of the document and cannot be cached, lazy-loaded or served in a different format per browser.
Data URL for HTML and CSS, where the MIME prefix is what tells the browser how to decode it. Raw Base64 for JSON fields and mail libraries, which usually declare the content type separately and choke on a duplicated prefix.
This page takes JPG, PNG and WebP. For vectors use the SVG to Base64 tool, which also offers the URL-encoded form — for SVG that is smaller and stays readable, unlike Base64.
The clipboard API only works on a secure origin. On HTTPS it is fine; on a plain HTTP page some browsers block it silently. Select the output text and press Ctrl+C or Cmd+C instead.
No. Encoding happens entirely in your browser with FileReader, and the page works offline.
Yes — free, no sign-up, no watermark.