Decode a Base64 string back into a real image
Paste the Base64 string
With or without the data URI prefix — standard or URL-safe Base64 both work.
Auto-detect format
The image format is detected from the actual data, not a guess.
Preview & download
View the decoded image with its dimensions and file size, then save it.
Paste a Base64 string or data URI and instantly get back a viewable, downloadable image — handy for debugging API responses, database-stored image data, or a JWT payload that carries an image.
Works with raw Base64 or a full data URI (with or without the data:image/...;base64, prefix), and with the URL-safe Base64 variant (-/_ instead of +//, padding optional) that JWTs and many APIs actually use — most tools only handle standard Base64 and reject that variant outright.
Format is auto-detected from the actual decoded data, not guessed from a file extension: PNG, JPG, GIF, WebP, BMP, and SVG are all supported. Everything happens entirely in your browser — nothing is uploaded.
Both — with or without the data:image/...;base64, prefix.
You'll see a clear error if the Base64 data can't be decoded into a valid image.
No — Base64 is just a way to represent binary data as plain text; it provides zero security or confidentiality. Anyone can decode a Base64 string back to the original file instantly, which is exactly what this tool does.
PNG, JPG, GIF, WebP, BMP, and SVG. Format is detected from the actual decoded data (binary magic bytes for the raster formats, the <svg> tag itself for SVG) rather than trusted from a file extension or declared MIME type, so it stays accurate even if the label is wrong.
Yes — Base64 has a second, URL-safe variant (using - and _ instead of + and /, usually with the padding = characters left off) that's what JWTs and many APIs actually produce. This is normalized automatically before decoding, so you can paste either variant directly.
Base64 has a fixed, unavoidable overhead: it represents every 3 bytes of the original binary data as 4 text characters, which works out to roughly 33% larger than the original file. That's not a bug or inefficiency in this tool — it's inherent to how Base64 encoding works.
For a handful of very small icons, it can be reasonable. For anything bigger, it's generally a bad trade today: the ~33% size overhead makes your HTML/CSS heavier, and the browser can no longer cache the image separately — it has to re-download every time the page does. The original justification (working around old browsers' limited simultaneous-connection caps) has also mostly disappeared now that HTTP/2 lets browsers transfer many files efficiently over one connection.
The most common causes: incorrect or missing padding, an invalid character that isn't part of the Base64 alphabet, or — if you've concatenated two separately-padded Base64 strings — a stray = character now sitting in the middle instead of only at the end. Standard vs. URL-safe charset differences are handled automatically here, so that specific mismatch shouldn't be the cause.
No — decoding happens entirely in your browser. Nothing you paste is sent to a server.
Yes — our Image to Base64 tool does the reverse direction, including SVG files, so both directions are covered.
In JavaScript, the same approach this tool uses: atob(base64String) to get the raw binary as a string, copy it into a Uint8Array byte-by-byte, then wrap that in a Blob with the right MIME type (or skip straight to new Image() with a data:image/...;base64,... string as the src, if you just need to display it). In C#, it's a single call: Convert.FromBase64String(base64String) returns the raw bytes directly, which you can write straight to a file with File.WriteAllBytes. Most other languages have an equally direct built-in Base64 decoder — the image-specific part is just knowing what to do with the resulting bytes.
Yes — once a valid image decodes successfully, a Download button appears next to the preview, saving it as a real image file with the correct extension.
Not with this tool — it's scoped to image formats specifically (PNG, JPG, GIF, WebP, BMP, SVG). Base64-encoded PDFs are a genuinely different, common need, but we don't have a dedicated tool for that yet.
Paste a Base64 string or data URI and get back a real, previewable, downloadable PDF file. Free, works entirely in your browser.
Convert a PDF file to a Base64 string, ready to embed in HTML, CSS, JSON, or an API payload. Free, works entirely in your browser.
Encode or decode URLs and URL components instantly. Supports both component encoding (encodeURIComponent, for query params) and full-URL encoding (encodeURI, preserves URL structure). Perfect for debugging query strings, API requests, and web forms.
Convert images to Base64 encoded strings instantly for easy embedding in HTML, CSS, JSON, or any text-based format. Supports all common image formats including PNG, JPG, GIF, WebP, and SVG. Features multiple output formats (Data URI, Plain Base64, HTML img tag, CSS background-image, JSON), drag-and-drop upload, real-time preview with file information, one-click copy to clipboard, and download as text file. Perfect for web developers embedding images inline, API responses with image data, email templates, offline web apps, and reducing HTTP requests. Shows original and Base64 file sizes with increase percentage. 100% client-side processing ensures complete privacy - images never leave your device.
Format, validate, and beautify JSON data instantly. Minify JSON, fix formatting errors, and validate JSON syntax online. Perfect for developers working with APIs and configuration files.