b2KIT

Data URI Decoder & Previewer

Paste a data: URI to preview the embedded content and download the original file.

Tested tool guide Tested browser tools Checked August 16, 2026

What Data URI Decoder & Previewer does, with a checked example

A data URI carries content directly after a data: header instead of pointing to a separate file. This tool separates the media-type header from the payload, decodes Base64 or percent-encoded data, previews supported content, and provides the decoded bytes as a download. The common mistake is overlooking the comma: everything before the first comma describes the content, while everything after it is the encoded payload. The ;base64 marker must appear in the header when the payload uses Base64.

Worked example

A concrete input and expected output from the current implementation.

Input

data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==

Expected output

Hello, World!

The header declares plain text and marks the payload as Base64. Decoding SGVsbG8sIFdvcmxkIQ== produces the 13 ASCII bytes spelling Hello, World!.

How the result is produced

1

Parsing the URI

A data URI starts with data:, followed by optional media-type information and then a comma. The tool uses that first comma to divide the header from the embedded content. If the header contains ;base64, the content after the comma is Base64-decoded. Otherwise, percent-encoded octets such as %20 are decoded from the payload.

2

Preview and download

The declared media type determines how the decoded content can be interpreted for preview. Text may appear as readable characters, while a supported image type can appear visually. Downloading preserves the decoded payload bytes rather than the literal data URI text. A data URI has no standard field for the original filename, so that name cannot be recovered from the URI alone.

Good uses

  • Inspect an inline image copied from HTML or CSS without first creating a file by hand.
  • Read text, JSON, SVG, or another textual payload embedded in a data: link.
  • Recover the decoded bytes from a Base64 data URI and download them as a standalone file.

Limits and checks

  • The media type is supplied by the URI author. A successful preview does not independently prove that the label correctly identifies the decoded bytes.
  • Base64 text by itself is not a complete data URI. It needs the data: header, a comma, and the ;base64 marker to be interpreted as Base64 here.
  • A malformed header, missing comma, invalid percent escape, or damaged Base64 payload can prevent decoding or produce content different from the intended file.

Common questions

Can I paste a normal http or https URL?

No. This decoder is for data: URIs whose content is embedded directly in the string. An http: or https: URL identifies a resource located elsewhere and does not contain that resource's bytes. Download the resource separately if you need to inspect an ordinary web URL.

Does the downloaded file retain its original name and extension?

Not necessarily. The data URI format carries a media type and payload but has no standard original-filename field. The tool can recover the decoded content, but it cannot reconstruct a filename that was never included. Choose an appropriate filename and extension based on the declared type and the content you verify.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools