1Tools

Base64 input

Image preview

Decoded image will appear here. Paste Base64 on the left and click Convert.

Image & Media

Base64 to Image

Paste a Base64 string or a full Data URL and get the original image back — previewed at its real size, ready to download. This converter detects PNG, JPG, GIF, SVG, WebP, BMP, TIFF, and ICO from the decoded bytes, so it works even when the string has no MIME prefix. Everything runs in your browser, so the image never leaves your device.

What you can do

  • Paste and preview

    Drop a Base64 string or Data URL into the input and the decoded image appears on the right. No upload step and no account.

  • Automatic format detection

    Bare Base64 often has no MIME prefix. This page reads magic bytes and identifies PNG, JPG, GIF, SVG, WebP, BMP, TIFF, and ICO from the decoded file header.

  • Real size and byte counts

    You see the image dimensions, the decoded file size, and the Base64 string length, so you can verify the result before you use it.

  • Download the restored file

    Save the image with the correct extension for the detected format, or copy a Data URL / bare Base64 string back to the clipboard.

  • Runs entirely in your browser

    Decoding never leaves your device. There is no upload endpoint and no server-side copy of the image.

How to use

  1. 01

    Copy a Base64 string or a full Data URL from your HTML, CSS, JSON, or API response.

  2. 02

    Paste it into the input on the left (or drop a .txt / .base64 file). The preview updates automatically — or click Convert.

  3. 03

    Download the restored image, or copy a Data URL / Base64 string from the preview actions.

About Base64 images and this converter

  • What a Base64 image is

    A Base64 image is a picture stored as text: the binary file bytes are mapped to a 64-character alphabet so the image can sit inside HTML, CSS, JSON, or an email without a separate file request. The common form is a Data URL such as data:image/png;base64,iVBORw0KGgo… — that single string is enough for an <img> tag or a CSS background.

  • The four parts of a Data URL

    A Data URL has four parts. It starts with data:, then a MIME type (for example image/png or image/jpeg), then an optional ;base64 marker, then a comma and the payload. Search phrases like data image png base64 and data image jpeg base64 are really asking about this structure. When the ;base64 marker is present, the payload is Base64; without it the payload is URL-encoded text instead.

  • Bare Base64 needs magic bytes

    Bare Base64 — a string with no data:image/…;base64, prefix — is harder to identify because encoding itself does not carry a file type. The only reliable signal is the magic number at the start of the decoded bytes. That is why a base64 image viewer that only accepts a full Data URL fails on the strings people copy from APIs and databases.

  • How this page detects format

    This page detects format from those magic bytes. PNG starts with 89 50 4E 47, JPEG with FF D8 FF, GIF with 47 49 46 38, BMP with 42 4D, WebP with RIFF….WEBP, TIFF with II*\0 or MM\0*, and ICO with 00 00 01 00. SVG is recognized from an <svg or <?xml…<svg text prefix. When nothing matches, the tool falls back to PNG, labels the result as unrecognized, and lets you pick the format manually.

  • Why Base64 makes images larger

    Base64 makes images larger. Every three bytes become four characters, so encoded length is about 4/3 of the original — roughly a +33% increase. The numbers shown after convert are measured from the actual decode, not a guess, which answers does base64 encoding increase size with a concrete byte count.

  • Three ways to use Base64 images in HTML

    In HTML you typically use a Base64 image in three ways: an <img src="data:image/png;base64,…"> attribute (the base64 image src pattern), a CSS background-image: url("data:…"), or a CSS url() inside another rule. Small icons and inline diagrams fit these patterns; large photos usually do not.

  • When not to inline large photos

    Do not inline large photos as Base64. A big Data URL bloats the HTML document, defeats separate caching of the image file, and slows first paint. Prefer a normal file URL for photos, and keep Base64 for tiny assets, offline embeds, or one-off debugging. Modern formats such as WebP or AVIF should usually be referenced as files, not pasted into markup.

  • Encoding, not encryption

    Base64 is encoding, not encryption. There is no key. Anyone who receives the string can decode it back into the original bytes. Do not use Base64 to hide sensitive pictures or secrets — use it for transport and local debugging only. For text Base64 encode and decode (not images), use the Base64 Encoder & Decoder on this site.

  • Need the reverse direction?

    If you need the reverse direction — turning a PNG or JPG into a Base64 string or Data URL — that is a separate tool (image to Base64). This page stays one-way so search intent for base64 to image stays focused on preview and download.

Private, exact, and free

  • 100% in your browser

    The Base64 string is decoded on your machine. Nothing is uploaded, and no copy of the image is stored on a server.

  • No sign-up

    Open the page and paste the string. There is no account, no login, and nothing to install.

  • The real file size, not a guess

    You see the decoded byte count, the image dimensions, and the detected format, so you can check the result before you use it.

  • Honest format detection

    The format is read from the decoded bytes, and the page says so when a format cannot be identified.

FAQ

Image to Base64Base64 Encoder & DecoderImage Metadata ViewerAll toolsBack to home

Missing a format or feature?

Missing something this page does not cover? Tell us — batch conversion and AVIF / HEIC support are the requests we are reading most. For the reverse direction, use Image to Base64.

Send feedback