ToolVaults

Data URI Encoder & Decoder — Text and Files

Encode text or any file into a data: URI for inlining in HTML, CSS, or JSON. Decode any data URI back to its MIME type and content. Base64 for binary, URL-encoding for text.

Runs 100% in your browser — nothing is uploaded.

Data URI

Frequently asked

When should I inline a data URI vs. link to a file?

Inline for tiny assets (favicons, small icons, single-color SVGs) where the extra HTTP request costs more than the ~33% base64 bloat. For anything over a few KB, or anything reused across pages, a real URL is faster because it can be cached.

What is the base64 checkbox for?

Text (SVG, JSON, plain text) works fine as URL-encoded, which is more compact. Binary (images, fonts) must be base64. The tool picks the correct mode for files automatically, and toggles for text.

Are there size limits?

Browsers accept data URIs up to a few MB, but performance suffers past ~100 KB. If you need larger, use a real URL — that's what CDNs are for.

Related tools