Free browser tool

Data URI generator / parser

Generate Data URIs from text/files and parse Data URIs.

Input and settings

How to use it

Encode plain text into a Data URI, or decode a pasted Data URI back into readable text. The tool is intended for text content rather than rebuilding arbitrary binary files.

  1. Paste either ordinary text or a value beginning with data:.
  2. For encoding, set the MIME type; for decoding, the MIME metadata comes from the Data URI.
  3. Select Run and review or download the resulting text.
Encode
data:MIME, + encodeURIComponent(text)
Decode
Percent-decoding or base64 decoding
Base64 detection
Looks for ;base64 in metadata
Output
Text-oriented result

Hello becomes a small text/plain Data URI

With MIME text/plain;charset=utf-8, the text Hello world is encoded into a data: URL whose payload uses percent encoding.

The decoder is text-oriented. Arbitrary binary base64 data may produce unreadable characters rather than a reconstructed image or file, so use a binary-specific tool for non-text payloads.

A Data URI has metadata before the first comma

The section between data: and the comma describes media type and optional encoding. The remainder is the payload.

Plain text is encoded into a URL-safe Data URI

Spaces and special characters are escaped so the resulting data: value can be copied into HTML or CSS without leaving raw text characters in the payload.

Base64 text payloads can be decoded

When a Data URI is marked as Base64, the tool can turn a text payload back into readable text. Image, audio or other binary payloads may not produce a useful text result.

Large Data URIs are not always practical

Inlining can remove a request but increases HTML/CSS text size and can hurt maintainability. Use Data URIs selectively rather than assuming smaller network count is always better.