Simple Counter is now an Android app.Our Android app is here. Become a founding tester and try it before anyone else.

Join the testers

Image converter · Free · No upload

Base64 to Image Converter

Short answer

To convert Base64 to an image, paste the string, with or without the data:image prefix, and the picture appears with its real format and pixel size, ready to download. The format is read from the decoded bytes, not the label. A string that fails is explained, and everything is decoded in your browser, never uploaded.

Paste the string, then save the image.

Paste Base64Paste a Base64 string or a data URL above, and the image appears here.
What the string decoded to
MeasureValue

The string is decoded in this browser and never uploaded; it is not kept either, only your file name and choices are. The picture is shown through an image element, so an SVG cannot run a script here. To change the pixel size of what you decoded, use the image resizer; to turn text into its bytes in hex, binary and Base64, use the ASCII, hex, binary, decimal converter.

Paste a Base64 string, or a whole data URL, <img> tag or CSS rule that contains one. The image is drawn at once, with its format found from the bytes and its size in pixels; if the string is damaged, the page says exactly what is wrong. Then download the picture, or copy it back out as a data URL, an <img> tag or CSS.

A Base64 image is a picture file written as text: every 3 bytes of the file become 4 characters, so it can sit inside a web page, a stylesheet or a JSON message. Decoding turns the text back into the original bytes.

  • No sign-up
  • Nothing uploaded
  • Finds the real format
  • Explains a failed string
  • Works offline

Key facts

Base64 to image converter at a glance
DetailAnswer
InputA Base64 string, a data URL, an <img> tag or CSS url() holding one, or a text file
Formats foundPNG, JPEG, GIF, WebP, BMP, ICO, SVG, AVIF, HEIC, TIFF
Save asThe original, or PNG, JPEG or WebP, if your browser can write it
Size limit30 million characters, refused with a message
Size cost of Base64About a third larger than the file
Where your string goesNowhere: it is decoded in this browser and not kept

How to convert Base64 to an image

Paste the string, check the preview, then save the picture.

  1. Paste the string

    A bare Base64 string or a whole data:image/…;base64,… URL both work.

  2. Read the report

    The format found from the bytes, the pixel size, the decoded size and the alphabet.

  3. Fix it if it is refused

    The message gives the cause: a character and where it is, or a cut-off string.

  4. Choose how to save

    The original format, or PNG, JPEG or WebP, under a file name you set.

  5. Download or copy

    Save the file, or copy a data URL, an img tag or a CSS background.

Who uses a Base64 to image converter

Anyone who has a picture as a long string of text and needs to see it or turn it back into a file.

  • Web developers

    Checking what an embedded data URL really contains.

  • API and database users

    Viewing an image field returned as Base64 in JSON.

  • Email and HTML authors

    Pulling an inline image out of a message or template.

  • Designers

    Saving an icon from a stylesheet as a file.

  • QA and support staff

    Finding out why a string will not display.

  • Students

    Seeing how bytes, Base64 and a picture relate.

Which image format a Base64 string is, by its first letters

Every image file starts with a few fixed bytes that say what it is, and those bytes become fixed letters at the front of the Base64 string. That is how this page knows the format with no file name and no data URL label, and how you can tell by eye. The signatures below are the ones the tool checks.

How a Base64 string begins, by image format
FormatString starts withFirst bytes (hex)MIME type
PNGiVBORw0KGgo89 50 4E 47 0D 0A 1A 0Aimage/png
JPEG/9j/FF D8 FFimage/jpeg
GIFR0lGOD47 49 46 38 (“GIF8”)image/gif
WebPUklGR52 49 46 46 (“RIFF”), then “WEBP”image/webp
BMPQk42 4D (“BM”)image/bmp
ICOAAABAA00 00 01 00image/x-icon
SVGPHN2Zy or PD94bW“<svg” or “<?xml” as textimage/svg+xml

Two cautions. UklGR is the start of any RIFF file, and a WAV sound or an AVI video begins the same way, so the tool reads the four letters after it to tell WebP from them. And the start only says what the file claims to be: it does not prove the rest is intact, which is why a string can be recognised as a PNG and still fail to draw. AVIF, HEIC and TIFF are recognised from their own signatures too, though most browsers cannot draw HEIC or TIFF; MDN’s image format guide lists which browsers support which.

Why a Base64 string will not turn into an image

Most “Base64 image not showing” problems come down to one of a handful of causes, and the tool names the one it finds instead of saying only that the input is invalid.

Why a Base64 string will not turn into an image
What you seeWhat is wrongThe fix
“Not valid in Base64” at a positionA character outside A–Z, a–z, 0–9, + and / slipped in: a quote, a comma, a stray letter from the surrounding codeDelete that character, or paste the whole data URL and let the tool cut it out
A length with 1 left overEvery 4 characters make 3 bytes, so a length of 4n + 1 is impossible: characters were lostCopy the string again from its source; it was cut off
An = in the middle= only pads the very end, so two strings were joined or text was pasted inside oneSplit them and decode each on its own
Valid, but “not an image”It decodes to a PDF, a ZIP, text or another file, not a pictureSave it with the right extension, or check what produced the string
Recognised, but no previewThe bytes start like a PNG or JPEG but the ending is missing (a truncated string), or the format is one browsers cannot drawCopy the string in full; for HEIC or TIFF save the file and open it in a program
The data URL has no ;base64Its data is plain or percent-encoded text, not Base64Only data URLs marked ;base64 are decoded here

Three things are forgiven rather than refused, because they are formatting and not damage: line breaks and spaces anywhere in the string, a missing = at the end (it is added, and the report says so), and the URL-safe alphabet that writes - and _ in place of + and /, which RFC 4648 defines for use in URLs and file names. A percent-encoded string (%2B for +) is decoded first.

Data URL, img tag or CSS: embedding a Base64 image

A data URL carries the file inside the address. Its form, as MDN describes the data: scheme, is data:[<media-type>][;base64],<data>. The media type is optional and defaults to text/plain, and ;base64 marks the data as Base64. So the same picture can be written three ways, and the tool shows whichever you choose, built from the real type it found in the bytes.

The same 12 × 12 PNG in the three snippet forms
FormWhere it goesStarts
Data URLAny place that takes an addressdata:image/png;base64,iVBORw0KGgo…
HTML <img>A web page, with width and height filled in<img src="data:image/png;base64,…" width="12" height="12">
CSS backgroundA stylesheetbackground-image: url("data:image/png;base64,…");

Embedding is for small things. Base64 writes every 3 bytes as 4 characters, so the string is about a third longer than the file, it cannot be cached apart from the page that holds it, and a large one slows that page. A small icon in a stylesheet is a reasonable use; a photograph is not. Browsers also block opening a data: URL as the address of a page, so one pasted into the address bar will not display, which is why this page draws it for you.

Nothing uploaded, and what to be careful of

Decoding runs here, and the picture is drawn as an image, never as a page. The string is turned into bytes by your browser and shown through an image element, which does not run scripts, so an SVG that carries one is drawn but cannot act. It is not sent to any server and it is not stored: reload the page and the box is empty, with only your file name and choices remembered.

Be careful with strings from a source you do not trust all the same. This page will not run an SVG’s script, but if you save an SVG and open it as a page in a browser, or paste it into a site that inlines it, that is a different situation, and one this tool cannot protect you from. A string that decodes to a PDF or an archive is reported as that and never opened.

And Base64 is an encoding, not a lock. Anyone can turn the string back into the picture, as this page does, so an image that is sensitive should not be treated as hidden because it was written this way.

What this page does not do

This decodes Base64 into an image file; it does not encode, edit or inspect the picture.

What this page does and does not do
It doesIt does not
Decode standard and URL-safe Base64, with or without a data: prefix and paddingTurn an image into Base64 (the other direction)
Name the format from the bytes and report a wrong labelTrust the label in the data URL over the bytes
Say why a string failed, with the position of a bad characterRepair a string that has lost characters
Save the original, or convert to PNG, JPEG or WebPResize, crop or edit (use the image resizer)
Show data URL, <img> and CSS snippetsUpload or keep your string

Animated GIF and WebP files are saved exactly as they are in the original format, so they keep moving; converting them to PNG or JPEG keeps only the first frame, because that is what a still format holds. A string larger than 30 million characters is refused with a message, since a browser tab cannot decode much more.

This page or a typical converter

What this page adds to a typical Base64 to image converter.

This Base64 to image page compared with a typical one
 This pageA typical Base64 to image page
CostFree, no sign-upFree
Your string is uploadedNeverVaries: check the page’s own statement
Format found from the bytesYes, and a wrong label is reportedOften
Why a bad string failedCharacter and position, length, truncationOften only “invalid”
URL-safe, missing = and line breaksAccepted and reportedVaries
Not-an-image bytes namedPDF, ZIP, text and moreVaries
Data URL, <img> and CSS snippetsYesSome

More converters

Every converter on the site runs in your browser, needs no sign-up, and sends nothing anywhere.

Frequently asked questions

How do I convert a Base64 string to an image?

Paste the Base64 string into the box, with or without the data:image prefix, and the picture appears. The tool decodes it in your browser, finds the format from the bytes and shows the pixel size. Then choose Download to save it, or pick PNG, JPEG or WebP if you want a different format from the original.

Which image formats are supported?

PNG, JPEG, GIF, WebP, BMP, ICO, SVG and AVIF are recognised and drawn by most browsers. HEIC and TIFF are recognised from their bytes too, but most browsers cannot draw them, so you can save the original file but not preview it. The format comes from the decoded bytes, not from the label in the data URL.

Do I need the data:image/png;base64, prefix?

No. A bare Base64 string works, because the format is read from the decoded bytes, and a full data URL, an img tag or a CSS rule containing one works too. If a data URL names a different type from the one the bytes show, the page uses the bytes and tells you the label was wrong.

Why is my Base64 image not showing?

Usually the string is damaged: a character outside the Base64 alphabet, an = in the middle, a length that cannot exist, or an end that was cut off. Paste it here and the page names the cause and the position of the first bad character. If it is valid but decodes to a PDF or text, it says that instead.

How do I know what image format a Base64 string is?

Read its first characters: iVBORw0KGgo is a PNG, /9j/ a JPEG, R0lGOD a GIF, UklGR a WebP and PHN2Zy an SVG. That works because the file's first bytes are fixed. This page does the check for you from the decoded bytes and lists what it found, including the first eight bytes in hex.

Can I convert Base64 to JPG or PNG?

Yes. Paste the string, pick PNG or JPEG under Save as, and download. The page redraws the decoded image through a canvas and writes the new format. Transparent areas are filled with white in a JPEG, and an animated image keeps only its first frame in a still format. An SVG has no fixed pixel size, so it stays SVG.

Are my files or data uploaded?

No. The string is decoded by your browser and the image is drawn from the bytes in memory, so nothing is sent to a server and nothing is kept: reload and the box is empty. Only your file name and choices are remembered. You can switch your connection off after the page loads and it still works.

Is Base64 the same as encryption?

No. Base64 is an encoding that rewrites bytes as 64 safe text characters so they can travel through systems built for text. It makes the data about a third longer and hides nothing, because anyone can reverse it, as this page does. Do not treat an image as protected because it is written in Base64.

Open the base64 to image converter

Free, no sign-up, and what you enter stays in your own browser.