Data URI Encoder

Wrap content in a data: URL with Base64 encoding. Set the MIME type in tool settings (default text/plain), paste content, and click Run.

  • Runs entirely in your browser
  • No data stored or sent to a server
  • Free forever — no signup
  • Instant conversion

Input and Output

Use the interactive encoder and decoder on this page to process your text.

Learn more about Base64

How to Encode Data URIs

Data URI Encoding

When to Use Data URIs

Embed small assets inline in HTML, CSS, or JSON using data: URLs — common for tiny icons, test fixtures, and email snippets. Base64 encoding keeps binary-safe text in a single string without a separate file fetch.

MIME Types

Set the MIME type in tool settings (default text/plain). Use image/png or image/svg+xml when embedding images. Incorrect MIME types may cause browsers to mis-handle decoded content.

Developer Tips

  • Large data URIs inflate HTML/CSS size — prefer external assets for big files
  • Review CSP rules — some policies restrict inline data URLs
  • This encodes content for debugging — not for hiding secrets

Frequently asked questions

Is a data URI encrypted?

No. Base64 encoding is reversible by anyone who sees the string.

Can I embed images?

Yes. Paste raw text content and set an appropriate image MIME type, or encode binary elsewhere first.