Image to Base64 Converter

Click or drop an image here (max 5 MB)
Reverse: paste a Data URL to preview the image

About this tool

Base64 encoding turns binary image data into plain ASCII text, so a picture can be embedded directly in HTML, CSS or JSON as a Data URL (data:image/png;base64,...). That removes an extra HTTP request, which is handy for small icons, logos and email signatures. This tool accepts PNG, JPEG, GIF, WebP, SVG and other image types up to 5 MB and outputs the full Data URL, the raw Base64 string and a ready-to-paste CSS background-image rule, plus a reverse mode that renders any pasted Data URL back into a picture.

Note that Base64 makes files about 33% larger than the original binary, so it is best for small assets. The conversion uses the browser FileReader API and happens entirely on your device — the image is never uploaded to any server, making it safe for private photos and internal design assets.

Related tools

Base64Color ConverterJSON Formatter