Image Size Reducer
Data URI tool

Convert Data URI to PNG

Take an inline image value as it appears in HTML, CSS, or a modern web application and recover the file inside it. The declared media type is shown alongside the decoded result, so the two can be checked against each other.

  • Reads the media type from the declaration
  • Handles encoded and percent-escaped forms
  • Shows what the payload really contains
  • Works on values copied from markup
  • Nothing pasted here leaves the device
Open the decoder

What the Wrapper Is Telling You

An inline image is a small header followed by the data, and the header is the only part that says what the rest of it is supposed to be.

A data URI exists so that an image can live inside a document that has no way of referring to a separate file. It begins with a short declaration that names the media type, then a marker for how the bytes were written, then the payload itself after a comma. Everything after that comma is the image, and everything before it is a label. The label is a claim rather than a fact. Nothing in the format enforces it, and mismatches are common when an asset is re-exported and the surrounding markup is not updated. That makes it worth reading the declaration before saving the file, because the extension to give the download depends on what is actually inside it, and the two do not always agree. To convert data URI to PNG is only correct when the payload genuinely holds a PNG, and the honest answer sometimes is that it holds something else.

What the Inline Image Tool Reads

Everything needed to convert data URI to PNG: the declaration, the payload, and both ways of writing the data section, with the decoded image shown against what the header claimed.

The declared media type

The label at the start of the value is reported, which is what decides the extension the recovered file should be saved with.

Both data forms handled

Encoded payloads and percent-escaped ones are both decoded, so the shape of the value never has to be worked out in advance.

A preview to compare against

The decoded image appears on the canvas, which is how a declaration that disagrees with the contents becomes obvious immediately.

The original bytes, not a copy

What comes out is the file that was embedded rather than a screenshot of it, so it can be resized and reused without loss.

Everything stays local

The value is decoded in the page, which matters for inline assets pulled out of production stylesheets and internal templates.

ImageSizeReducer

ImageSizeReducer

@imagesizereducer

An image embedded in a stylesheet

Small graphics are frequently built into CSS files so a page needs one fewer request. A background texture, a bullet icon, or a tiny logo becomes a value rather than a file, and the stylesheet stays self-contained. Recovering the original is a routine need. Somebody needs to update the graphic, hand it to a printer, or reuse it on a platform that does not read stylesheets. To convert data URI to PNG is the whole of the work here, and what comes out is the original asset rather than a re-encoded copy.
Decode this value
Stylesheet rule containing an inline image value beside the recovered asset
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Reading the declaration before anything else

The header names the media type and states whether the payload is encoded or percent-escaped. Reading it takes a second and answers the question that otherwise gets settled by trial and error. It is also how a mismatch shows up. A value that declares one type and decodes into something else has usually been through a re-export, and saving it under the declared extension produces a file that some applications will refuse to open. The declaration and the preview are the two halves of the answer.
Decode this value
Declaration highlighted at the start of a long inline image value
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Encoded and percent-escaped are different things

The data section of a URI can be written in two ways. The encoded form maps three bytes onto four readable characters and is by far the more common, because it survives every transport that handles text. The escaped form leaves the bytes alone and replaces only the characters that would break a URI, using a percent sign and two digits. It is shorter for text-based formats and appears most often with vector graphics. Both forms are readable here, so the shape of the value does not have to be identified first.
Decode this value
Comparison of encoded and percent-escaped payload forms
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

A markup attribute holding the whole picture

Image elements and stylesheet rules both accept inline values, which is how a single file can carry its own graphics without any external references. That is useful for email, where external requests are often blocked, and for documents that have to move around as one piece. Pulling a value out of an attribute is where the declarations tend to get mangled, since copying from a rendered page can capture surrounding markup. Taking the value from the source rather than from what the browser drew is the difference between a payload that decodes and one that fails part way through.
Decode this value
Markup attribute containing an inline value that decodes to a complete image
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Not every embedded payload is an image

The same mechanism carries fonts, small stylesheets, and occasionally documents, and a value copied out of a project may not be a picture at all. Decoding it still works and still produces the right bytes. What changes is the answer. A payload that resolves to a font is not something to save with an image extension, however tempting it is to treat every long string as a picture. Checking the declaration first is what prevents a file from being written with an extension that has nothing to do with its contents.
Decode this value
Long inline values for an image and for a font shown with different declarations
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Where the value came from decides nothing

A declaration can be produced by a build step, pasted from a browser inspector, lifted out of an email template, or generated by an application at runtime. The mechanism is the same in every case, and the payload is indifferent to its origin. That is worth remembering when one source is trusted more than another. A value generated by a build tool is not more likely to be valid than one extracted from a template, and a value that fails does so for reasons in the string rather than in the pipeline that produced it.
Decode this value
Inline values from several sources shown to be equivalent in form
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Recovering an asset that only exists inline

Embedded graphics are frequently the only surviving copy of a file. The original was lost, the source project was archived, and the only place the picture still exists is inside a stylesheet that has been in production for years. Extracting it returns the asset itself rather than a screenshot of it, which means it can be resized, recolored, and reused without any of the damage that copying from a rendered page would introduce. That distinction matters more than it sounds when the asset is a logo or an icon that will appear at several sizes, and it is the main reason to convert data URI to PNG rather than take a screenshot.
Decode this value
Asset recovered from an old stylesheet and reused at a larger size
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Where the overlap with a plain decoder lies

The two tools do the same mechanical work and differ in what they assume about the input. A plain decoder expects a payload: something copied out of a database field, a log entry, or an application response, with no wrapper around it. This one expects the wrapper, because the interesting questions about an inline value concern the declaration rather than the bytes. Where the value has been trimmed of its header already, either tool will read it, and where the header is intact, the one that reports the media type is the more useful of the two.
Decode this value
Wrapped value and bare payload shown with the different questions each raises

How to Extract the File

Three steps, and the second is the one that matters most, since the declaration is what tells you which extension a recovered file should carry.

Step 1

Paste the whole value

Include the declaration at the start. Nothing needs to be trimmed manually, and any line breaks from a wrapped value are handled during decoding.

Step 2

Read the media type

The header is reported alongside the decoded image. Check that the two agree, and note the type, because it determines the extension the file should be saved with.

Step 3

Download the recovered file

Save the result and name it according to its actual contents. What comes out is the embedded asset itself, not an approximation of it.

Who Extracts Inline Assets

Four kinds of work where a picture exists only as a value inside a document.

ED

Email developers

templates with every graphic embedded

Templates arrive self-contained because external requests are unreliable in mail clients. When a graphic has to be reused elsewhere, decoding the value is the only way to get it back out as a file.

FD

Front-end developers

small assets built into a stylesheet

Inlining small graphics is a sensible performance decision and a poor storage decision. Being able to pull the original back out means the source project does not have to be found every time.

BM

Brand managers

marking assets recovered from old builds

A logo used on a page for years sometimes exists nowhere else. Extracting it from the stylesheet gives a clean file rather than a screenshot, which matters when it has to go to a printer.

TW

Technical writers

documents that carry their own images

A single file that travels with everything inside it is a good delivery format and an awkward archive. Decoding the values turns it back into a folder of ordinary assets.

Frequently Asked Questions

What the declaration means, and the cases where it needs to be treated with suspicion.

The declaration read, the file recovered

Paste the inline value in full, check the declared media type against the decoded image, and download what the payload actually contains.

Decode this value
Read the Label First

The header is the only thing describing the payload

An inline value carries no other description of itself. There is no filename, no modification date, and nothing in the data that says what it is meant to be, which leaves the declaration in the header as the single source of that information. It is worth reading before saving anything, because a mismatch between the label and the contents is the most common way a recovered file ends up with an extension that has nothing to do with what is inside it.

Smaller files, same picture.