File to Base64 Data URI Converter (Any File Type)

Encodes a chosen file as Base64 in the form you need and shows its type and size.

Use the tool

Why this tool exists

Small images, fonts and icons can be inlined to save requests. The same trick moves a file through a text-only channel.

The tool reads the file locally, uses the type the browser reports or detects it from the first bytes, and prints a data URI, plain Base64, a CSS url() value or an HTML tag. It warns when the result is large, because inlined data cannot be cached on its own.

How to use it

  1. Choose a file.
  2. Pick the output form.
  3. Copy the result.
  4. Paste it into your HTML, CSS or message.

Frequently asked questions

Is there a size limit?

Only your browser memory. Large outputs are slow to paste and slow pages down.

Is the file uploaded?

No.

When should I inline?

For tiny assets. Above about 10 KB a separate file is usually better.

Which tool decodes it back?

Use Base64 to File or the Data URI Inspector.