Image Size Reducer
Base64 to PNG tool

Convert Base64 to PNG

Decode an encoded image string into the picture it represents and save it as a file. Both forms are accepted: a full data URI with its prefix, and a bare payload copied from an API response, a log, or a configuration file.

  • Accepts a data URI or a bare payload
  • Tolerates line breaks and stray whitespace
  • Preview before you download
  • Long strings handled without truncation
  • Nothing pasted here leaves the device
Open the decoder

What the String Actually Contains

Base64 is a way of writing binary data using only characters that survive being copied through systems designed for text.

An image file is a block of bytes, and bytes do not travel well through places that expect readable text. JSON, email headers, HTML attributes, and log files all have opinions about which characters are allowed, and a raw binary block breaks most of them. Base64 solves that by re-expressing every three bytes as four characters from a small alphabet of letters, digits, and two symbols, which turns any file into a string that survives the trip. The cost is that the string is about a third longer than the file it represents, and completely opaque to read. To convert Base64 to PNG is to reverse that mapping and reconstruct the original bytes, which is a mechanical decoding step with one interesting complication: the string alone does not say what the bytes are. The full form, called a data URI, carries a label declaring the media type, and the bare form does not.

Why Convert Base64 to PNG in the Browser

A decoder that accepts the string as it was copied, whether that includes a prefix, line breaks, or neither.

Both forms accepted

A full data URI is trimmed back to its payload automatically, and a bare string is decoded as-is, so the input does not have to be prepared first.

Whitespace tolerated

Line breaks from a wrapped encoder and stray spaces from a copy and paste are stripped before decoding rather than treated as data.

Preview before saving

The decoded image is shown on the canvas, which is how a truncated string or a mismatched media type becomes obvious immediately.

Saved as a real file

The output is an ordinary image file that can be opened, edited, and uploaded anywhere, rather than a preview that only exists on the page.

Decoded on the device

The string is processed in the page and never sent anywhere, which matters for payloads pulled from private APIs or internal logs.

ImageSizeReducer

ImageSizeReducer

@imagesizereducer

An API response with the image inside it

Services that return images as part of a JSON document have to encode them, because JSON cannot carry binary data directly. The result is a response with a very long string field where a file would otherwise be. To convert Base64 to PNG is faster than writing a script for a one-off inspection, and it gives a visual answer rather than a byte count. Where the response is something that will happen repeatedly, the same decoding is worth automating, but for checking what an endpoint actually returned there is no better tool than looking at it.
Decode this string
JSON response containing an encoded image string shown beside the decoded picture
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

A string copied out of a log or a console

Debug output often includes encoded payloads, and a truncated print puts a fraction of the string in front of you with no indication of where it was cut. Whether that fraction decodes to anything recognizable is usually the first question. It is also the quickest way to tell one kind of failure from another. A string that decodes into the expected image means the encoding is fine and the bug is elsewhere, which removes half the possible causes in a few seconds.
Decode this string
Console output with an encoded string beside the decoded preview
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

The prefix is optional and frequently missing

A complete data URI begins with a short declaration that names the media type and states that the payload is encoded. Everything after the first comma is the payload itself, and that part is what a decoder actually needs. Strings reach you in both shapes. Values copied out of an HTML attribute usually keep the prefix; values copied out of a JSON field or a database column usually do not, because the label lives in a separate field. A tool that accepts either form saves you from having to work out which one you are holding before you convert Base64 to PNG.
Decode this string
Data URI prefix highlighted above the payload that follows the comma
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Line breaks in the middle of a long string

Some encoders wrap their output at a fixed width, inserting a newline every seventy-six characters to keep lines readable in an email or a text editor. The newlines are formatting rather than data, and a decoder that treats them literally will fail. Whitespace at the beginning and end of a pasted string causes the same problem. Both are handled here, so a value that was copied out of a wrapped email body or pasted with a trailing newline decodes as though the formatting were never there.
Decode this string
Wrapped encoded string with line breaks removed before decoding
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

The media type is a label rather than a promise

The prefix in a data URI says what the payload is supposed to be, and nothing enforces it. A string can declare one type and contain another, which is exactly what happens when an image is re-encoded and the surrounding markup is not updated. The bytes are what they are. To convert Base64 to PNG always rebuilds the original data faithfully, but saving it with an extension that matches the label rather than the contents produces a file that some applications will refuse to open. Checking the decoded image and the declared type against each other is worth the second it takes.
Decode this string
Declared media type compared against the actual decoded image
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

An image embedded in an email or a stylesheet

Embedding images directly into markup avoids a separate file request and keeps a single document self-contained, which is why email templates and small stylesheets use it. The trade is that the image is now buried inside text and cannot be used as a file. Extracting it back out is a routine need: a client sends a template, a logo needs to be reused somewhere else, or a graphic in a stylesheet has to be handed to a printer. Decoding the string is the whole of the recovery process, and the result is the original file rather than a re-encoded approximation.
Decode this string
Image extracted from an embedded stylesheet and saved as a file
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Very long strings and how they behave

A megabyte of image data becomes roughly one and a third megabytes of text, which is a lot of characters to put in a box. Performance in a browser depends on the machine, and on very large payloads the decoding step takes a visible moment. What matters is that the result is not silently truncated when you convert Base64 to PNG. A decoder that quietly gives up part way through produces a partially rendered image or an error, and both are easy to mistake for a corrupt source. Working from the full string, however long it is, is the only way to be sure the answer is trustworthy.
Decode this string
Large encoded payload decoded in full without truncation
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Where this ends and a data URI tool begins

The two overlap more than the names suggest, and the distinction is about where the string came from rather than what it contains. So does a value pulled out of a database column: it is a bare string, and to convert Base64 to PNG is what this tool is for. A value taken out of an HTML attribute, a CSS rule, or a browser address bar is a URI, and the interesting questions about it concern the wrapper: which media type was declared, how the data was encoded, and what the label should become. A tool built around that shape of input is the better fit for it, and this one remains the right choice for anything that is only the payload.
Decode this string
Bare payload compared with a full data URI and the parts each contains

How to Decode the String

Three steps, and the only thing worth checking afterwards is whether the media type declared in the string matches what you convert Base64 to PNG expecting to see.

Step 1

Paste the value

Drop the string into the input, complete with any prefix or formatting. Nothing needs trimming first, and line breaks are handled during decoding.

Step 2

Check the decoded image

The picture appears on the canvas. This is the moment to notice that the declared type and the contents disagree, since the preview shows what the bytes actually are.

Step 3

Download the PNG

Save the file and give it an extension that matches its real contents. The result is the original image data, not a re-encoded approximation.

Who Decodes These Strings

Four kinds of work where an image exists only as text and needs to become a file.

BD

Backend developers

API responses that embed images as strings

Checking what an endpoint actually returned is far quicker by pasting the field into a decoder than by writing a script. It is the difference between seeing the image in seconds and in minutes.

ED

Email developers

templates with inline assets

Templates arrive with every graphic embedded, and the original files are unavailable. Decoding pulls them back out so they can be reused, resized, or handed to somebody who needs an actual asset.

QA

QA engineers

log excerpts attached to bug reports

A payload in a log tells you whether the encoding is the problem or something further down the line. Being able to look at the picture rather than reason about the string removes an entire category of guesswork.

DA

Data analysts

image fields exported from a database

Some tables store images as encoded text, and the question is often simply what is in there. Decoding a couple of rows by hand is the fastest way to find out before designing an export.

Frequently Asked Questions

What the string represents, and how the two common forms differ.

From an unreadable string to a file you can open

Paste the value, check the decoded preview against the declared media type, and download the bytes it actually contains.

Decode this string
Text All the Way Down

The string says nothing about what it holds

Base64 is a transport format, and a transport format is not obliged to describe its cargo. That is why a payload can declare one media type and contain another, why a truncated string produces a picture that is almost right, and why the preview matters more here than in most tools. The bytes that come out are exactly the bytes that went in, so once the image is on screen the question is settled and no further conversion has taken place.

Smaller files, same picture.