Decode a Base64-encoded JPEG image to view and download it as a .jpg file. Works with raw Base64 or full data URIs.
JPEG is a lossy raster format optimized for photographs and complex images. JPEG files always start with the byte sequence FF D8 FF — we look for this signature to confirm what you’ve pasted. For graphics or anything with sharp edges, PNG is usually better.
JPEG files always start with the bytes FF D8 FF. After Base64 encoding, this typically appears as /9j/ at the start of the string. If your string starts with /9j/, it is almost certainly a JPEG.
There is none — they are the same format. The .jpg extension exists because early Windows file systems limited extensions to three characters. Both names map to MIME type image/jpeg.
JPEG is much smaller for photographs and complex images, often 5–10× smaller than PNG. PNG is better for graphics with sharp edges, transparency, or large flat color regions. If the original was photographic content (a photo, a screenshot of a webpage), JPEG was likely the right choice.
JPEG files always begin with the byte sequence FF D8 FF — a marker called Start of Image (SOI). The fourth byte varies depending on the JPEG variant: E0 for JFIF (the most common), E1 for EXIF (typical of camera output), or other values for specialty formats. After Base64 encoding, this signature appears at the start of the string as /9j/ — if your Base64 starts with those four characters, you can be confident it is a JPEG.
JPEG files end with an equally distinctive marker, FF D9, called End of Image. Files truncated during transfer may decode but appear corrupted or partially rendered — viewers typically show a gray bar at the bottom where the image data was cut off.
If you are not sure whether your Base64-encoded image is a JPEG or PNG, our tool detects this automatically. The decision between formats matters more than format conversion: JPEG is lossy and ideal for photographs — gradients, faces, scenery, anything with smooth color transitions. JPEG can compress a 24-megapixel photo from 70 MB raw to 8 MB or smaller with minimal visible quality loss. PNG is lossless and ideal for graphics — logos, icons, screenshots, diagrams, or any image with sharp edges or transparency. Re-encoding a JPEG as PNG actually makes the file larger.
If your Base64 starts with /9j/, you have JPEG. If it starts with iVBORw0KGgo, you have PNG. If it starts with R0lGOD, you have GIF. If it starts with UklGR, you have WebP. Each format is best decoded with the tool tuned for that format, but our generic Base64 to Image tool detects and renders all of them.
Several common scenarios produce Base64-encoded JPEGs. Profile photo APIs typically return user avatars as Base64 inside JSON responses so the frontend can render them inline without a separate HTTP request. Photo upload services often accept Base64-encoded images in request bodies — convenient for mobile apps that already have the image as a string. Screenshot tools and PDF generators embed page snapshots as Base64 JPEGs inside HTML reports and PDFs. Email clients sometimes inline JPEG attachments as Base64 in the HTML body to ensure they display even when external images are blocked.
Progressive JPEGs are worth a special mention. They include multiple compression layers so the image renders at increasingly higher quality as more data arrives — useful for slow connections. After Base64 encoding, a progressive JPEG is identical in size to a baseline one; the rendering behavior is determined by the decoder.
The Base64 encoding does not affect image quality — it is a lossless representation of the underlying binary bytes. If your decoded JPEG looks compressed or blocky, that compression was applied before encoding. JPEG quality settings (typically 1–100) trade visual fidelity against file size. A typical web JPEG uses quality 75–85, which produces files about 1/10 the size of quality 100 with no perceptible difference.
If you need a smaller file, re-export the JPEG at a lower quality setting in your image editor before encoding. Base64 cannot reduce the size — it can only inflate it by 33%.