Something wrong with this tool?
About Image BASE64 Online
This tool encodes an image file as a Base64 string and provides a CSS data URI (data:image/png;base64,...) ready to embed inline in HTML, CSS, JSON, or Markdown.
Inline-encoded images are useful when you need a self-contained HTML page, when reducing HTTP requests for small assets like icons, when embedding images in email templates that may strip external references, or when generating dynamic images server-side.
The tool supports PNG, JPEG, GIF, WebP, SVG, and ICO inputs. Be aware that Base64 encoding adds about 33% to the file size, so it's best suited for small images (under 10 KB).
How to use this tool
How to encode text to base64 or decode base64 to text
Pick the direction
"Mode" toggles between Encode (text → base64) and Decode (base64 → bytes-as-text). The label below the radio explains which way the bytes are flowing.
Fill the payload
"Text to encode, or base64 to decode" is one field reused by both modes. In Encode it takes UTF-8 text; in Decode it takes a base64 string with the standard A–Z a–z 0–9 + / = alphabet (a data: URL prefix is stripped automatically).
Press Run
Encode returns base64 (no padding adjustments needed). Decode returns the UTF-8 view of the bytes, the byte count, and a 48-character hex preview from the start of the buffer.
Watch for binary in Decode
If the decoded bytes contain a null byte, the result includes a note flagging that the payload is likely binary, not text. Read it as bytes (download or hex view) instead of UTF-8.