Image to Base64 Converter & Decoder
Convert a supported PNG, JPEG, WebP, GIF, or BMP image to Base64, a data URI, CSS background value, or HTML image snippet. Paste a supported image data URI or raw Base64 string to preview and download it. Conversion happens in this browser tab.
Encode a small image or decode image Base64
Choose a direction. Your image and text stay in this browser tab; nothing is uploaded.
Encode image for code
Choose an image file to encode.
Base64 text is about one third larger than the original image bytes. SVG and non-image data are rejected. The 5 MB limit helps avoid excessive browser memory use.
What this tool helps with
Developers and creators sometimes need to embed a small image in HTML, CSS, JSON, or a text-only payload, or recover an image from a data URI in source code or an API response.
How to use it
- To encode, choose one PNG, JPEG, WebP, GIF, or BMP image up to 5 MB.
- Choose the output form: data URI, raw Base64, CSS background, or HTML image snippet. Copy the text when ready.
- To decode, paste a Base64 image string or data URI and choose Preview image.
- Inspect the preview and detected image type, then download the decoded image if needed.
Requirements
A modern browser with JavaScript, FileReader, Base64, Blob, and image rendering support. Clipboard permission is optional; the output can be selected and copied manually.
Limits and privacy
Input is limited to 5 MB to avoid excessive memory use. Base64 text is about one third larger than the original binary image. SVG and non-image payloads are intentionally rejected. Animated GIF bytes are kept intact when encoded or downloaded, but the browser preview may show only one frame. Raw Base64 is accepted only when its decoded bytes match a supported raster image signature. The text stays in this browser tab and is not uploaded. Inputs are processed locally in this browser. The site does not provide an upload endpoint for this tool.
Frequently asked questions
Does Base64 reduce image size?
No. Base64 representation is about one third larger than the original binary data. Use it mainly for small images that need to be embedded as text.
Can I use the result in CSS or HTML?
Yes. Choose CSS background or HTML image snippet to wrap the data URI in the corresponding syntax. Verify the output in your project and consider the larger text size.
Is my image uploaded?
No. Encoding, validation, and preview happen in the current browser tab. The site does not provide an upload endpoint for this tool.
Does the decoder accept SVG?
No. SVG is active markup as well as an image format, so this tool accepts only supported raster image signatures.
Step-by-step guide
Convert an image to Base64 or decode a data URI in your browser →
Related tools
Image Compressor — Target 100 KB, 200 KB or 500 KB · Image Metadata Remover — EXIF & GPS Cleaner