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.
ⓘ Nothing to convert yet
Nothing to convert yet — paste your data or drop a file to begin.
Inspection Report
- 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
- Paste the Base64 string into the input box. A data:image/jpeg;base64,... Data URI works too.
- The tool validates the Base64 and decodes it, then checks the decoded bytes for the JPEG file signature.
- Review the inspector: detected type, MIME, dimensions and decoded size.
- Look at the preview to confirm the image is intact.
- 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.