Image to Base64
Convert any image into a Base64 data URI, CSS rule, or HTML snippet, or decode Base64 back to an image.
Settings
Data URI
How to Use Image to Base64 in 3 Steps
Load an image or string
Drop an image onto the left pane, or paste a Base64 string or data URI into the text box below.
Choose an output format
Open Settings to switch between a data URI, raw Base64, CSS background-image, HTML img tag, or Markdown.
Copy or download
Copy the generated Base64 snippet, save it as a .txt file, or download the decoded image.
Image to Base64: Frequently Asked Questions
Is my image uploaded anywhere?
No. Your browser decodes and processes the image on an HTML5 canvas on your device. Nothing goes to a server.
Are original image bytes encoded without recompression?
Yes. The encoder converts exact file bytes into Base64 text, so decoding restores the identical binary file.
Why is Base64 larger than the original image?
Base64 represents every 3 bytes as 4 text characters, increasing size by about 33%. Inline only small icons under 10 KB.
Can I decode raw Base64 back into an image?
Yes. Paste a full data URI or raw Base64 string, and the tool detects PNG, JPG, GIF, WebP, or SVG headers.
Does Base64 encoding work with SVG files?
Yes. SVG files encode cleanly and output a standard image/svg+xml data URI.
Explore All Media Tools
Compress, convert, resize, and edit image, video, GIF, and audio files locally in your browser.