Data URI Generator — Free Online Tool

Convert text, SVG, CSS or HTML into a data: URI (base64 or URL-encoded). Data URI Generator is a free online tool from the ToolsRift Encoders & Decoders collection. It runs entirely in your browser — nothing to install, no signup, and your data never leaves your device.

Loading Data URI Generator

How to use Data URI Generator

Paste your content, pick its MIME type, and choose base64 or URL-encoded output. Copy the resulting data: URI straight into your HTML src, CSS url() or JavaScript.

Frequently asked questions

When should I use URL-encoding vs base64?

URL-encoding is usually smaller for text-based content like SVG and keeps it human-readable; base64 is more robust for arbitrary/binary content and older parsers.

Why embed content as a data URI?

It inlines assets directly into HTML or CSS, removing a network request — great for small icons, SVGs and CSS backgrounds.

Which MIME type should I pick?

Match the content: image/svg+xml for SVG, text/css for stylesheets, text/html for markup, application/json for JSON, or text/plain for raw text.

More Encoders & Decoders

Base45 Encoder / Decoder
RFC 9285 Base45 encode & decode, as used in EU COVID QR certificates
Ascii85 Encoder / Decoder
Adobe Ascii85 (base85) encode & decode with z shortcut and <~ ~> delimiters
Z85 Encoder / Decoder
ZeroMQ Z85 (RFC 32) base85 encode & decode for 4-byte-aligned binary data
Base62 Encoder / Decoder
Compact 0-9A-Za-z Base62 encode & decode, ideal for short IDs and URLs
Base64 ↔ Hex Converter
Convert Base64 directly to hexadecimal and back without leaving your browser
Punycode / IDN Converter
RFC 3492 Punycode encode & decode for internationalized domain names (xn--)

← View all Encoders & Decoders