Free to use, no account

File to Base64 & Data URI

Encode a file on your device as Base64 text or a data URI with its MIME type. Preview common raster images, copy the result or download it as text. No upload or account.

One file up to 2 MiB. The file is encoded on this device; nothing is uploaded.

MIME type comes from the browser file metadata; it is not a format or safety check. Image preview is limited to PNG, JPEG, GIF, WebP, BMP and AVIF. SVG and documents are not opened in the preview.

How do I convert a file to Base64?

Choose one file up to 2 MiB and select Convert. Copy or download the data URI, or switch to Base64 only. The MIME type is read from the browser and may be unknown.

Frequently asked questions

How do I convert a file to Base64?

Choose one file up to 2 MiB and select Convert. Copy or download the data URI, or switch to Base64 only. The MIME type is read from the browser and may be unknown.

Is my file uploaded or stored?

No. The selected file is read and encoded in this browser. Nothing is sent to a server or saved by this tool. The browser needs extra memory for the file and its encoded text.

What is a Base64 data URI?

It is text that starts with data:, includes a MIME type and ;base64, and then contains the file bytes encoded as Base64. It can be used in supported HTML or CSS contexts.

Does this upload the file or verify its real type?

No. Encoding happens in your browser. The displayed MIME type comes from browser file metadata and is not verified against the bytes.

Can I turn any file into a data URI?

Most files can be represented as Base64 text, but not every website or browser feature accepts every MIME type. This tool encodes one file up to 2 MiB.