Convert any image to a Base64 string for HTML, CSS, or APIs.
Click to select an image or drag and drop here
Supports JPG, PNG, GIF, WebP, SVG
Embedding an image as a Base64 data URL lets you inline the image directly inside HTML, CSS, or JSON without a separate file. Our tool reads an image from your device and produces a ready-to-paste data URL — entirely client-side, so your image never leaves your browser.
A data URL takes the form data:[mime-type];base64,<encoded bytes>. The browser decodes the Base64 and renders the image as if it had been fetched from a server. Common MIME types include image/png, image/jpeg, image/gif, image/webp, and image/svg+xml.
Drop or select your image file. The tool reads the bytes locally with the FileReader API, encodes them, and shows the resulting data URL. Copy it with the provided button and paste it directly into your CSS background, an <img> src attribute, or an HTTP request body.
Inlining is best for small icons (under about 4 KB) that are reused across many pages. It removes the extra HTTP request and prevents flicker. For larger images keep them as separate files because Base64 grows the byte size by about 33 percent and prevents browser caching of the image independently from the HTML.
No. Base64 is a lossless encoding of the original bytes. The image you decode is identical to the file you uploaded.
Base64 represents three bytes of binary data as four printable ASCII characters, so the encoded form is about 33 percent larger before HTTP compression.
Yes. The conversion runs entirely in your browser. The image bytes are never uploaded to our server.