{ }jsonkit
Format
Validate
Convert
Query
Generate

Data URI encoder and decoder

Create inline data URLs or get back their text and bytes.
MIME type
Encoding
48 B · paste or drop a file
1
✓ complete48 B → 107 B0.0 ms

About Data URI Encoder / Decoder

The Data URI encoder and decoder creates data: URLs from UTF-8 text. It also decodes existing Data URIs back to text or the exact binary bytes.

How it works

Base64 or percent encoding

Base64 is compact for binary and non-ASCII content. Percent encoding keeps simple text readable. Text MIME types get an explicit UTF-8 charset when encoded.

Strict decoding

The media type, parameters and Base64 marker are parsed separately. Invalid Base64 characters, wrong padding and incomplete percent escapes cause an error. They are never repaired behind your back.

Text preview or binary download

Valid UTF-8 shows as text. Other bytes get a summary, a canonical Base64 value to copy and a download named after the MIME type.

Frequently asked questions

What is the default MIME type when none is given?

The Data URI spec defaults to text/plain. The decoder reports that type when the media type is missing.

Which encoding should I choose?

Use percent encoding for short readable text. Use Base64 for binary or text that needs a lot of escaping. Base64 makes the data about one third larger.

Can Data URIs be very large?

Browsers and apps set different URL length limits. For large assets, a normal file or a blob URL is usually a better fit.

Sources & last verified

We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.

Found a wrong result or an outdated claim? Report an error and we will check it again.