Base64 to JPEG: Decode Data URIs to a JPG File

Paste a Base64 string or data URI and download a real JPEG. Decoding runs entirely in your browser, nothing is uploaded. Free, instant, private.

Browser Native
Privacy First
Free Tool

Convert Now

or

Drag & drop your file here

or

How It Works

You copied a Base64 blob out of a JSON API response, a CSS `background-image`, or a debugger watch window, and now you need it as a file you can actually open. Paste the string (raw, or a full `data:image/...;base64,` URI) into the box, or upload a `.txt` that holds it, and you get a JPEG to download. The decode happens in your browser tab. The text never reaches a server. Mechanically: the tool strips any `data:` prefix up to the first comma, runs the payload through `atob` to recover the raw bytes, then hands those bytes to the browser's image decoder. Whatever the bytes actually are (JPEG, PNG, WebP, GIF) gets drawn to a canvas, which is then encoded to JPEG at quality 0.92. That final step is a genuine lossy re-encode, so if your source bytes were already a JPEG, you are paying a second compression pass. For a quick "let me see this thing" that is invisible; for an archival master, decode back to the original format instead. The catch worth flagging: JPEG has no alpha channel. Before encoding, any transparent pixels are painted onto a solid white background. A logo or icon with a see-through background comes out sitting on a white rectangle. If you need the transparency kept, use the Base64 to PNG tool instead.

Related Conversion Tools

Discover more powerful converters that might be useful for your workflow

Base64 to Image: Decode Any Data URI to PNG Free

Paste a Base64 string or data: URI and decode it to a viewable PNG file. Runs in your browser, handles any image format, nothing uploaded.

Base64 to PNG: Decode Data URIs in Your Browser

Paste a Base64 string or data: URI and decode it to a PNG locally. Keeps alpha transparency, no uploads, no server. Pure client-side decode.

HEIC to JPG Converter: Open iPhone Photos Anywhere

Convert iPhone HEIC/HEIF photos to JPG in your browser. Opens on Windows, Android, and the web. No uploads, nothing leaves your device. Free and instant.

.heic.heif
Try Now

PDF to JPG: One JPEG Per Page, Fully In-Browser

Render each PDF page to a separate JPG in your browser. Pages flatten onto white, encode as JPEG, and multi-page files download as a ZIP. No uploads.

WebP to JPEG Converter: Fast, Private, In-Browser

Convert WebP to JPEG free in your browser. Files never leave your device, transparency flattens to white, and the JPEG opens in apps that reject WebP.

.webp
Try Now

PNG to PDF: Merge Multiple Images Into One File

Combine many PNG images into one multi-page PDF in your browser. Drag to reorder pages, keep pixels sharp, nothing uploaded. No account, no watermark.

Key Features

  • No file uploads required - works offline
  • 100% privacy focused - client-side processing
  • Browser powered - no software installation
  • Fast processing - WebAssembly technology
  • Free forever - no premium accounts

Supported File Formats

.txt

Output Format: JPG

Technical Specifications

input Format Base64 text or data: URI (raw payload, or full data:image/...;base64, prefix)
output Format JPEG (.jpg), baseline, quality 0.92
compression Type Lossy DCT re-encode; decoded image drawn to canvas, then encoded to JPEG
quality Retention Re-encoded at quality 0.92, not bit-identical; a second lossy pass if the source was already JPEG
color Space Support RGB output; alpha channel flattened onto white (JPEG has no transparency)
max Resolution Limited only by your device's memory
processing Time Instant, runs in your browser

Key Benefits

  • Paste a string directly or upload a .txt, no upload-to-server step
  • Handles full data: URIs and bare Base64 payloads automatically
  • Decoding and encoding stay on your device, so the data stays private
  • Outputs a standard .jpg that opens and attaches anywhere
  • Works offline once the page has loaded
  • Accepts Base64 of PNG, WebP, or GIF sources and normalizes them to JPEG

Common Use Cases

  • Saving an image returned as a Base64 field in a JSON API response
  • Extracting an inline data: URI from a CSS or HTML file as a real photo
  • Turning a Base64 string stored in a database column back into a viewable JPEG
  • Seeing what an encoded payload actually looks like while debugging
  • Pulling a photo out of an email template or exported design token
  • Recovering a usable image from a log entry or pasted code snippet

Pro Tips

  • Strip surrounding JSON quotes and line breaks before pasting, or the decode will fail
  • If the source was a transparent PNG, keep it; JPEG fills transparency with white
  • For very long strings, save them to a .txt file and upload that instead of pasting
  • If the source was already a JPEG and you need original quality, decode to its native format rather than re-encoding here
  • Convert URL-safe Base64 (with - and _) to standard Base64 (+ and /) before pasting

Frequently Asked Questions

Both. Paste a complete data:image/jpeg;base64,/9j/4AAQ... string and the tool drops everything up to the first comma for you. Or paste just the encoded payload with no prefix. Either decodes to JPEG. You can also upload a .txt file if the string is too long to paste comfortably.
No. Decoding and JPEG encoding both run in JavaScript inside your browser tab. The string you paste, any file you upload, and the JPEG you download never leave your device. Verify it yourself: open DevTools and watch the Network tab during a conversion, or just go offline first and convert anyway.
Not byte-for-byte. The tool re-encodes to JPEG at quality 0.92, which is lossy. If your Base64 was already a JPEG, that is a second compression pass on top of the first, so expect slightly softer hard edges and gradients. At normal viewing size on photos it is hard to spot; for pixel-exact work, decode to the source format rather than re-encoding here.
JPEG cannot store transparency, so before encoding, the alpha channel is flattened onto a white background and transparent regions become solid white. That is expected, not a bug. To keep the transparent background, decode the same string with the Base64 to PNG converter.
Usually the string is truncated, carries line breaks or stray quotes from being copied out of code, or it is URL-safe Base64 (using - and _ instead of + and /), which atob rejects. Copy the entire payload, strip any surrounding JSON quotes and trailing characters, and if it was concatenated across lines in source, join it back into one continuous block.
There is a 100 MB cap on the input, but the real ceiling is your device's memory, since the decoded bitmap lives in the browser. Base64 text is about 33% larger than the binary it encodes, so a 100 MB string decodes to roughly 75 MB of image data. Big strings are fine on desktop; very large ones can be slow on a phone.
Base64 to JPEG always outputs a lossy .jpg with a white background, best for photos and when file size matters. Base64 to PNG keeps transparency and is lossless. Base64 to Image preserves whatever format the data URI declared. Pick this one when the source is a photo or you specifically need a .jpg.
Inline Base64 is handy for embedding images in HTML, CSS, JSON, or email, but you can't open it in an image viewer, attach it, or run it through other tools. Decoding it back to a real JPEG gives you a normal file to save, share, or inspect. Developers do this constantly when debugging API responses or pulling embedded assets out of code.