Convert Base64 to JPG

Paste Base64 image data to validate the JPEG signature, preview the picture and download it as a .jpg — locally, in your browser.

Input — Base64○ Waiting for input

Nothing to convert yet

Nothing to convert yet — paste your data or drop a file to begin.

Your files and data stay in your browser.

Inspection Report

Result metadata
Detected Type
MIME Type
Encoding
Input Length
Decoded Size
Padding Status
Data URI
File Signature
Preview Availability

How to convert Base64 to JPG

To convert Base64 to JPG, paste the Base64 string or image Data URI into the tool above. It validates the data, checks the FF D8 FF JPEG magic bytes in the decoded content, and shows a preview with width and height. You can then download the image as a .jpg file. Everything runs in your browser; nothing is uploaded.

How to Use

  1. Paste the Base64 string into the input box. A data:image/jpeg;base64,... Data URI works too.
  2. The tool validates the Base64 and decodes it, then checks the decoded bytes for the JPEG file signature.
  3. Review the inspector: detected type, MIME, dimensions and decoded size.
  4. Look at the preview to confirm the image is intact.
  5. Click Download to save the .jpg, or Copy to keep the cleaned Base64.

Real Example

Base64 image data from APIs and HTML files usually starts with /9j/ when it holds a JPEG, because that is the encoding of the FF D8 FF bytes every JPEG opens with. Paste a complete string here and the inspector reports Detected Type: JPEG, MIME: image/jpeg, Decoded Size: 96 KB — and the preview shows the picture with its dimensions (for example 800 × 600) before you save it.

Code Snippets

// Decode Base64 to a JPG and download it (browser) const bytes = Uint8Array.from(atob(base64), c => c.charCodeAt(0)); const blob = new Blob([bytes], { type: 'image/jpeg' }); const url = URL.createObjectURL(blob); const a = Object.assign(document.createElement('a'), { href: url, download: 'image.jpg' }); a.click(); URL.revokeObjectURL(url);

How Base64 to JPG Works

Trusting the file type a Data URI claims is a common bug source: a label can say image/jpeg while the bytes say otherwise. This tool decodes first, then reads the actual leading bytes of the result. Only when the FF D8 FF JPEG signature is really there does it offer the image preview and .jpg download; otherwise it tells you what the data appears to be instead. The download is the exact decoded byte stream — no recompression, no quality loss, no metadata added or removed.

Common Use Cases

  • Recovering a photo that arrived as Base64 in an API response or email source.
  • Checking whether a Base64 image string really holds a JPEG before using it.
  • Extracting inline images from HTML or Markdown files for editing.
  • Turning a stored Base64 thumbnail back into a real image file.

FAQ

How do I know whether my Base64 contains a JPEG?
JPEG data in Base64 form almost always starts with /9j/. This tool goes further and checks the actual decoded bytes for the JPEG signature, then shows the detected type in the inspector.
Can I paste a Data URI instead of plain Base64?
Yes. Paste the full data:image/jpeg;base64,... string and the prefix is detected and stripped automatically.
The tool says my data decoded but is not a JPEG — what now?
The decoded bytes matched a different format, so the tool tells you what it actually found. If the Base64 itself looks suspicious, run it through the Base64 Validator for a full diagnostic report.
What file do I get when I download?
A .jpg file containing the exact decoded bytes — byte-for-byte identical to the image that was originally encoded.
Why is my Base64 invalid for this tool?
Usually missing padding, URL-safe characters, or whitespace copied along with the string. The error message names the exact cause and offers a one-click fix; the Base64 Validator explains any problem in more detail.

Related Tools