Code · Made a little simpler

Data URI Generator

Generate a data URL from a local file or UTF-8 text. Choose Base64 or percent encoding, set the media type, and copy or download the complete URI.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

Data URI Generator: how to use it

  1. Choose Base64 for binary files or percent encoding for readable text. Check the media type.
  2. Run the conversion and inspect the byte count and available text preview.
  3. Copy the complete text or download the result to check its contents.

Limits and notes

Up to 12 MiB of original or decoded bytes. Pasted text and encoded files use UTF-8. The preview shows up to 8,192 characters. Downloads contain the complete result.

How your privacy works →

Data URI Generator: common questions

Does a data URL include the original filename?

It carries the media type and payload. Choose a filename when restoring the file.

Can I encode an empty file?

Yes. Its data URL ends immediately after the payload separator and restores zero bytes.

Guides