https://devtools.solutions/tools/files/file-to-base64.html

File to Base64

Select any file and convert it to a Base64-encoded string or data URL. Runs in your browser.

Frequently Asked Questions

What file types are supported?

Any file type. The tool reads the raw bytes and produces a Base64-encoded data URL regardless of format.

What is the output format?

A data URL like data:image/png;base64,iVBORw0KGgo... which can be used in HTML img src attributes or embedded in JSON.

Is my file uploaded to a server?

No. The browser's FileReader API reads the file locally. Nothing is uploaded.

Example input/output

Input: image.png (5 KB binary file)

Output: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...

How it works

This tool uses the browser's FileReader API with readAsDataURL() to read the selected file and produce a Base64-encoded data URL. Processing runs entirely in your browser.

Common use cases

Related tools