About online Base64 to image decoding
Logs, API responses, and HTML snippets sometimes carry a PNG or JPEG as a long Base64 string or a full data URL. Paste either form on this page to see the picture immediately and save it as a file when the preview matches what you expect.
A data URL starts with data:image/png;base64, (or jpeg/gif/webp) followed by the payload. APIs often return only the payload—this tool detects PNG/JPEG/GIF/WebP file signatures when the prefix is missing.
Online Base64 to image capabilities
Paste & preview
The textarea accepts a complete data URL or raw Base64 from JSON fields. The preview panel updates as you edit; use Download image to save PNG, JPEG, GIF, or WebP with the correct extension.
Data URL vs raw payload
- Data URL: data:image/<type>;base64,<payload> — paste the entire string from img src or CSS.
- Raw Base64: only characters after the comma — common in REST bodies with a separate content-type field.
- Both decode to the same file bytes when the payload is valid image data.
Format detection
- With a data URL, the MIME prefix tells the browser how to render the bytes.
- For raw input, PNG/JPEG/GIF/WebP magic bytes are checked after Base64 decode.
- Arbitrary text or non-image Base64 shows an error instead of a broken preview.
Pair with image → Base64
Use image to Base64 when you need to embed a file in HTML or JSON. Use this page for the reverse—inspecting a payload from a ticket, verifying an upload field, or saving an inline asset to disk.
Common use cases
Preview a data URL from HTML
Copy src="data:image/…" from a template, paste into the input, and confirm the asset before editing. Download if you need the original file on disk.
Inspect API image fields
Paste the Base64 field from a JSON response (with or without the data: prefix). Check MIME and byte size under the preview header, then download for design or QA.
Recover an inline icon
Email or PDF exports sometimes embed tiny PNGs as Base64. Decode here instead of hand-rolling atob scripts when you only need a quick visual check.
Frequently asked questions
- How do I turn Base64 into an image online?
- Paste a data URL or raw Base64 into the input on this page. When decoding succeeds, the preview shows the image and Download image saves it with the matching file extension.
- Do I need the data:image/…;base64, prefix?
- Not always. A full data URL works as-is. Raw API payloads without the prefix are accepted when the decoded bytes match PNG, JPEG, GIF, or WebP file headers.
- Which formats are supported?
- PNG, JPEG, GIF, and WebP—the same set as the image to Base64 encoder. Other MIME types in a data URL or undetectable binary after decode are rejected with a clear error.
- Why does my string fail to decode?
- Common causes: truncated copy, line breaks inside the payload (whitespace is stripped), wrong alphabet characters, or Base64 that encodes text rather than an image file. Re-copy from the source or encode a test file on the image to Base64 page and paste here to verify the round trip.
- Is the download always PNG?
- The file extension follows the detected format—.png, .jpg, .gif, or .webp—so the saved file matches the original image type.
Input patterns
data:image/png;base64,…Full data URL from img src or CSS url()Raw JSON fieldPayload only — detection uses PNG/JPEG/GIF/WebP signaturesWhitespaceLine breaks in the payload are ignored during decodeimg src="…"Paste the attribute value if it is a full data URL