Image to Base64
Encode an image as a Base64 string or data URI, with ready-made HTML, CSS and JSX snippets.
Drop an image to encode
Produces a Base64 string or a full data URI, plus copy-ready snippets.
JPG · PNG · WebP · AVIF · GIF · BMP · TIFF · SVG
When inlining is worth it
Base64 inflates a file by roughly a third and cannot be cached separately from the document that contains it. It is a good fit for tiny assets — icons, 1px gradients, placeholders — and a poor one for photographs.
When to use Base64 images
Base64 turns a file into plain text, so a small image can live inside HTML, CSS, JSON or an email template without a separate request. The encoder uses the original file bytes unchanged.
Copy the full data URI or the bare Base64 string, or a ready-made snippet for an HTML <img>, a CSS background-image, Markdown or JSX. The character count, size and overhead are shown.
Base64 is about a third larger than the binary file, so it suits icons and small images. For photos, a normal image file is almost always better.