Image ↔ Base64 Converter
Convert images to Base64 strings and decode Base64 back to images
Drag and drop an image here, or browse
About Image Base64 Converter
Convert images to Base64 encoded strings for embedding in HTML, CSS, or JSON. Supports PNG, JPEG, GIF, WebP, SVG, and more. The decoded image can be downloaded in its original format. All processing happens locally in your browser.
Frequently Asked Questions
How do I convert an image to a Base64 data URI for embedding in HTML or CSS?
Drag and drop an image onto the upload area or click Browse to select a file. The tool reads the image locally, encodes it to Base64, and outputs either a full data URI (data:image/png;base64,…) or raw Base64 depending on your selection. You can use the data URI directly in an src attribute or CSS background-image property.
Is my image uploaded to a server during Base64 conversion?
No. The image is read using the browser’s File API and encoded entirely in JavaScript on your device. No file data is transmitted to any server. This makes the tool suitable for converting screenshots, design assets, icons, or any other image file without privacy concerns.
When should I use Base64-encoded images versus external image files?
Inline Base64 images eliminate an HTTP request for small images like icons, logos, or data-URI placeholders, which can reduce page load time in specific scenarios. However, Base64 encoding inflates image size by about 33%, increases HTML or CSS file sizes, bypasses browser image caching, and is harder to update. The general recommendation is to use Base64 only for very small images (under ~2 KB) used inline.
How do I decode a Base64 string back to a viewable image?
Switch to the Base64 → Image tab, paste the Base64 string (with or without the data URI prefix), and the tool decodes and renders a preview of the image. You can then inspect the image or download it. If the string is truncated or corrupted, the preview will fail to render.
What image formats does this Base64 converter support?
The converter accepts any image format the browser can display, which typically includes PNG, JPEG, GIF, WebP, SVG, AVIF, and ICO. The file browser filter is set to image/*, so non-image files are excluded by default. The output data URI includes the correct MIME type based on the detected file type.