Data URI Inspector: Decode a Data URL – Free

This data URI inspector splits a data URL into its media type, its encoding and its decoded bytes. Paste the URL to check what it really contains, and download the payload as a file.

How to use the Data URI inspector tool

  1. Paste the complete URL, starting with data:, into the Data URL box. Select Example to load a short Base64 sample.
  2. Select Inspect to parse the header and decode the payload.
  3. Read the four result lines: Type, Encoding, Bytes and First bytes, which lists up to 64 bytes in hexadecimal.
  4. Select Download to save the decoded payload as data-url.bin, or Copy to copy the four-line report.

How a data URL is put together

RFC 2397 defines the data URL scheme as data:, an optional media type, an optional ;base64 marker, a comma, and then the data. The part before the first comma is the header. The rest is the payload, written as Base64 or as percent-encoded text.

When the media type is missing, the RFC says to assume text/plain. This inspector applies the same default. It reports the part of the header before the first semicolon as the type, so parameters such as charset=utf-8 are not shown on the Type line.

Worked example of a data URI inspection

The Example input holds the word Hello in Base64. The inspector finds the ;base64 marker, decodes SGVsbG8= to five bytes and prints them in hex: 48 is H, 65 is e, 6c is l twice and 6f is o.

A URL without the marker, such as data:,Hello%2C%20World, is reported as Percent or plain text with 12 bytes, because %2C and %20 decode to a comma and a space.

data:text/plain;base64,SGVsbG8=

Type: text/plain
Encoding: Base64
Bytes: 5
First bytes: 48 65 6c 6c 6f

Decoding rules and limits

These points describe exactly what the parser accepts and how it fails.

  • The input must start with data: and contain a comma. Otherwise the tool asks for a URL that starts with data: and contains a comma.
  • The payload is treated as Base64 only when ;base64 is the last item in the header, which is where RFC 2397 places it.
  • Base64 payloads may use the standard alphabet or the URL-safe one with - and _. Spaces and line breaks are ignored, and padding is optional.
  • Percent escapes in the Base64 payload are decoded first. For example, %3D supplies a padding character. Invalid alphabet characters still produce an error.
  • Each percent escape supplies one byte, so %FF produces the byte FF. Literal text is encoded as UTF-8. Each % must be followed by two hexadecimal digits.
  • Only the first 64 bytes appear in the report. The download always contains every decoded byte.

Reading the first bytes as a file signature

Many formats begin with a fixed signature, so the hex preview often confirms what a payload is, whatever the header claims. The download is always named data-url.bin, so rename it with the right extension once you know the format.

  • 89 50 4e 47 0d 0a 1a 0a starts a PNG image.
  • ff d8 ff starts a JPEG image.
  • 47 49 46 38 spells GIF8, the start of a GIF image.
  • 25 50 44 46 spells %PDF, the start of a PDF document.
  • 50 4b 03 04 starts a ZIP archive, including DOCX and XLSX files.

Frequently asked questions

What is the difference between a data URI and a data URL?

They are two names for the same thing. RFC 2397 calls it the data URL scheme, while data URI is the common informal name. This tool accepts any string that follows that syntax.

Is the data URL I paste uploaded anywhere?

No. Parsing and decoding happen in JavaScript on this page, and the download is generated from memory in your browser. Neither the URL nor its payload is sent to a server.

Why does the inspector say Percent or plain text for my Base64 data?

The ;base64 marker is missing or is not the last header item before the comma. For example, data:text/plain;base64;charset=utf-8,SGVsbG8= is read as plain text, and the eight characters of the payload are reported as eight bytes.

Can I preview an image stored in a data URL here?

This tool reports bytes and offers a raw download; it does not render the payload. To see the picture, use the Data URL to image tool, or rename the downloaded data-url.bin with the correct image extension.

How do I find the real size of an embedded file?

Read the Bytes line. It is the size of the decoded payload, not the length of the URL. A Base64 data URL is about one third longer than the bytes it carries, plus the header.

Related tools