Image to Base64
Convert any image to Base64 data URI instantly. Copy the encoded string for CSS backgrounds, HTML img tags, or embed directly in JSON and code.
① Drop or select an image file ② Choose output format (Base64 / Data URL) ③ Copy the encoded string
The FileReader API reads your image file and converts it to a Base64-encoded data URI. Everything runs in the browser — your file never leaves your device.
Base64 encodes binary data as ASCII text, using 64 printable characters. A data URI combines the MIME type and Base64 string into a single embeddable string starting with data:.
Use Base64 images to eliminate HTTP requests for small icons, embed images in CSS, store images in JSON APIs, or use in email HTML where external images are blocked.
Image to Base64 — how data URI encoding works
Base64 encoding converts binary data (like image files) into a text string using only ASCII characters. A Data URL (data:image/png;base64,…) embeds the encoded data directly into an HTML or CSS file, eliminating the need for a separate HTTP request. The browser's FileReader API reads the file and produces the string entirely client-side. Use it for small icons in <img src="data:..."> tags, CSS background-image, or JSON APIs. The encoded string is approximately 33% larger than the original binary, so Base64 is best used for files under 10–20 KB.