Data URI Generator & Decoder

Create and inspect data URIs. Turn text into a data: URL with your choice of media type and percent or Base64 encoding, convert any number of files at once, or paste a data URI to see what's inside — its media type, encoding, parameters and real size — with a preview and a download of the decoded file. It's free, runs in your browser, and files never leave your device.

Anatomy of a data URI

PartExample
Schemedata:
Media typeimage/png
Parameters;charset=utf-8
Encoding flag;base64
Payload,iVBORw0KGgo…

When to use it

  1. Embed a small icon or font directly in CSS or HTML.
  2. Check what an unfamiliar data: link in an email or page contains before opening it.
  3. Recover the original file from a Base64 data URI in a JSON payload.
  4. Make a self-contained HTML snippet for a bug report.

How to Use

  1. Choose From text, From files, or Inspect.
  2. For text, set the media type and encoding; for files, drop them in.
  3. Copy the data URI in the format you need.
  4. To inspect, paste a URI and read the details or download the decoded file.

Features

  1. Text to data URI (percent or Base64)
  2. Any number of files at once
  3. Inspect type, parameters and size
  4. Image and text preview
  5. Download the decoded file
  6. ZIP export
  7. 100% client-side

FAQs

What is a data URI?

A URL that contains the file itself: data:, a media type, an optional ;base64 flag, a comma and the data.

Base64 or percent-encoding?

Binary files need Base64. For text, percent-encoding is readable and usually smaller.

How much bigger does Base64 make a file?

About a third bigger — every 3 bytes become 4 characters.

Is it safe to open a data URI from someone else?

Inspect it first. HTML data URIs are used for phishing pages; this tool shows what's inside without opening it.

Are my files uploaded?

No. Encoding and decoding happen in your browser.

Technical Details

A data URI, defined in RFC 2397, embeds a file directly in a URL as data:[media type][;parameters][;base64],payload. For text the payload can be percent-encoded, which keeps it readable and is often shorter; for binary it must be Base64, which grows the data by a third. The generator writes either for text, with the chosen media type and a UTF-8 charset, shows both sizes, and turns any number of dropped files into Base64 data URIs using each file's own type. The inspector doesn't trust what it's given: it checks the data: prefix and the comma, validates the media type, defaults to text/plain as the RFC specifies when none is given, separates parameters like charset, decodes the payload and reports its real size. Images are previewed and text is shown, and the decoded bytes can be downloaded as a file. An HTML data URI is flagged, since that format is a common phishing technique and browsers block top-level navigation to it. Everything is processed locally.

Developer Tools

Developer Tools

  • SVG to CSS Converter
  • CSS Data URI Converter
  • Basic Auth Header Generator
  • Hex Dump Viewer
  • Text Encoding Inspector
  • Punycode Converter
  • Email Obfuscator
  • UUID Validator