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.
Frequently asked
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.
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.
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
- Base64 Encode / DecodeEncode or decode Base64 text. UTF-8 safe by default. Optional URL-safe variant.
- Base32 Encoder / DecoderEncode any text to RFC 4648 Base32 (A-Z, 2-7) or decode Base32 back to text. UTF
- URL Encode / DecodePercent-encode or decode URLs, query strings, and path segments. Choose between
- HTML EntitiesEncode and decode HTML entities: &, <, ©, and every numeric &#nn
- Morse Code TranslatorTranslate text to Morse code and back. Full alphabet, digits 0-9, and common pun
- Punycode / IDN ConverterConvert international domain names (IDN) with Unicode characters into Punycode (