Base64Doc

Decode Base64 Payloads to JPEG Images

100% Browser Local · 0 File Uploads · 100MB+ Ready

Validate FF D8 FF JPEG headers locally, inspect frame dimensions from SOF markers, and convert decoded images to .jpg, .png, or .webp without uploading photos.

Try 1-Click Synthetic Samples (Zero-Trademark):

Drop any file, paste Base64, or press Ctrl/Cmd+V with clipboard files or raw API JSON

Runs inside a local Web Worker. Network tab stays at 0 file POST requests.

0 chars
Decoded Result & Document Actions Appear Here

Paste any Base64 string, Data URI, Postman JSON, SOAP XML, HAR, or EML payload on the left.

Interactive Synthetic Showcase Gallery

Load real client-side verified payloads straight into the workbench above. Zero third-party trademarks.

Free · InstantCASE-1

Shipping API JSON -> 2 Auto-Named PDFs + 180 deg Label Fix

Input Payload
Raw Shipping API JSON (4.8 KB)
Verified Output
waybill_label.pdf (4x6 in, 180 deg -> 0 deg) + commercial_invoice.pdf (A4, 2 pages)
Real browser-decoded output preview (client-side only)
Free · InstantCASE-2

ERP Payload -> PK\x03\x04 Verified 3-Sheet Excel Preview

Input Payload
ERP Base64 Payload (122.8 KB)
Verified Output
Summary (128 rows x 11 cols), LineItems (48 rows), Tax (24 rows) -> .xlsx / .csv / .json
Real browser-decoded output preview (client-side only)
Free · InstantCASE-3

Broken Data URI + MIME Fix + White Transparent Logo

Input Payload
Broken data:image/jpeg;base64 + \/ + newlines (4.9 KB)
Verified Output
Auto-fixed to image/png (512x512 px) + Checkerboard reveals white emblem
Real browser-decoded output preview (client-side only)
Free · InstantCASE-4

Gzip + Base64 Unpack & Korean EUC-KR Mojibake Self-Heal

Input Payload
Gzipped Base64 (212 chars) + EUC-KR Receipt
Verified Output
Gunzipped JSON + EUC-KR Hangul receipt recovered from UTF-8 replacement chars
Real browser-decoded output preview (client-side only)
Free · InstantCASE-5

40-Page Contract Slimming + Gateway Green-Light Check

Input Payload
40-Page Synthetic Contract PDF (33.7 KB)
Verified Output
Extract Page 1 -> +33.3% Base64 fits comfortably under 4.5 MB Vercel limit
Real browser-decoded output preview (client-side only)

Decoding /9j/ JPEG Streams & Fixing Non-Standard MIME Prefixes

Identify true FF D8 FF JPEG payloads regardless of prefix errors and normalize non-standard image/jpg headers to canonical image/jpeg.

Read full technical details

Almost every valid JPEG Base64 payload starts with the signature characters /9j/, produced by encoding the mandatory JPEG Start-of-Image marker (FF D8) plus marker prefix (FF). Yet upstream APIs routinely wrap those bytes in image/jpg (invalid under strict RFC MIME parsers) or hardcode image/png.

Base64Doc ignores misleading string prefixes, inspects the binary SOI and APP0/APP1 markers directly, repairs the Data URI prefix to image/jpeg, and blocks blind .jpg saves whenever someone accidentally pastes a PDF or PNG stream.

Diagnosing Truncated JPEG Payloads (Missing FF D9 EOI)

Spot half-gray or clipped decoded photos caused by mid-transfer database column truncation or shell copy-paste limits.

Read full technical details

When a decoded JPEG renders the top strip normally and fills the bottom half with solid gray blocks, the Base64 string was almost always truncated before reaching the JPEG End-of-Image marker (FF D9)—often due to a VARCHAR size cap in SQL or a truncated terminal log line.

Inspecting decoded byte counts alongside visual rendering lets you verify completeness immediately before archiving inspection photos or KYC documents.

Local Privacy for Identity Photos, Scans & Medical Captures

Decode sensitive camera uploads and inspection receipts entirely inside browser memory with zero remote server caching.

Read full technical details

KYC verification selfies, warehouse damage photos, and scanned receipts carry sensitive EXIF metadata and personal details. Processing every byte inside a local Web Worker guarantees zero third-party retention and supports one-click conversion to .png or .webp locally.

Step-by-Step Local Workflow

STEP 1

Paste JPEG Base64 or Mislabeled Data URI

Paste strings starting with /9j/4AAQ, full Data URIs, or JSON inspection responses; wrapper quotes and JSON \/ slashes clean automatically.

STEP 2

Verify FF D8 FF Header & Canonical MIME

Base64Doc checks leading JPEG Start-of-Image bytes and corrects non-standard image/jpg or false image/png prefixes to canonical image/jpeg.

STEP 3

Check Pixel Resolution & Visual Quality

Preview the decoded photo on Light, Dark, or Checkerboard canvas and confirm intrinsic pixel width and height parsed from the frame.

STEP 4

Download .jpg or Transcode Locally

Save the verified JPEG file immediately, or click Save .png / Save .webp if downstream tooling expects another raster format.

Technical Specification Summary

CapabilityBase64Doc BehaviorEngineering Notes
JPEG Magic HeaderFF D8 FF (Base64: /9j/)Covers JFIF (FF E0), EXIF (FF E1), and Adobe APP14 (FF EE) variants.
Canonical IANA MIMEimage/jpeg (not image/jpg)Automatically normalizes non-standard Data URI headers to image/jpeg.
Frame Dimension MarkersSOF0 (FF C0) / SOF2 (FF C2)Reports real baseline or progressive pixel width and height.
EOI Truncation AwarenessTrailing FF D9 markerMissing FF D9 leaves the lower half of decoded photos gray or clipped.
Cross-Format Export.jpg / .png / .webpClient-side canvas export without transmitting private photos.

Frequently Asked Questions

Does Base64Doc distinguish .jpg from .png even when the Data URI says image/png?

Yes, it inspects the raw FF D8 FF magic bytes rather than trusting the prefix text, flagging the conflict immediately and repairing the MIME type to image/jpeg.

Why do JPEG Base64 strings always begin with /9j/?

Every JPEG opens with the 3 bytes FF D8 FF (SOI plus next marker prefix), which encode directly to the four Base64 characters /9j/ (specifically /9j/4 for JFIF/EXIF).

Can I convert a decoded JPEG Base64 image into PNG locally?

Yes, click Save .png in the image micro-action bar after decoding to export a browser-rendered PNG file without server uploads.

Why is the bottom half of my decoded JPEG solid gray?

A gray lower region indicates the Base64 string was truncated before the final FF D9 End-of-Image bytes, usually by a database column limit or clipped log line.

Should Data URIs use image/jpg or image/jpeg?

Always use image/jpeg, which is the official IANA media type; non-standard image/jpg headers fail in strict validators and PDF assemblers.

Explore All 34 Base64 Converters & Developer Tools