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)
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.
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.
Paste any Base64 string, Data URI, Postman JSON, SOAP XML, HAR, or EML payload on the left.
Load real client-side verified payloads straight into the workbench above. Zero third-party trademarks.
Identify true FF D8 FF JPEG payloads regardless of prefix errors and normalize non-standard image/jpg headers to canonical image/jpeg.
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.
Spot half-gray or clipped decoded photos caused by mid-transfer database column truncation or shell copy-paste limits.
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.
Decode sensitive camera uploads and inspection receipts entirely inside browser memory with zero remote server caching.
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.
Paste strings starting with /9j/4AAQ, full Data URIs, or JSON inspection responses; wrapper quotes and JSON \/ slashes clean automatically.
Base64Doc checks leading JPEG Start-of-Image bytes and corrects non-standard image/jpg or false image/png prefixes to canonical image/jpeg.
Preview the decoded photo on Light, Dark, or Checkerboard canvas and confirm intrinsic pixel width and height parsed from the frame.
Save the verified JPEG file immediately, or click Save .png / Save .webp if downstream tooling expects another raster format.
| Capability | Base64Doc Behavior | Engineering Notes |
|---|---|---|
| JPEG Magic Header | FF D8 FF (Base64: /9j/) | Covers JFIF (FF E0), EXIF (FF E1), and Adobe APP14 (FF EE) variants. |
| Canonical IANA MIME | image/jpeg (not image/jpg) | Automatically normalizes non-standard Data URI headers to image/jpeg. |
| Frame Dimension Markers | SOF0 (FF C0) / SOF2 (FF C2) | Reports real baseline or progressive pixel width and height. |
| EOI Truncation Awareness | Trailing FF D9 marker | Missing FF D9 leaves the lower half of decoded photos gray or clipped. |
| Cross-Format Export | .jpg / .png / .webp | Client-side canvas export without transmitting private photos. |
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.
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).
Yes, click Save .png in the image micro-action bar after decoding to export a browser-rendered PNG file without server uploads.
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.
Always use image/jpeg, which is the official IANA media type; non-standard image/jpg headers fail in strict validators and PDF assemblers.
Avoid Chrome data: URI truncation and memory leaks when rendering Base64 PDFs in JavaScript using Uint8Array, Blob URLs, and Web Workers.
Fix binascii.Error Incorrect padding and binary mode corruption when decoding Base64 PDFs, Excel sheets, and images in Python.
Diagnose why base64 -d, atob, or APIs fail with invalid input: data: prefixes, URL-Safe -/_ chars, JSON \/ escapes, whitespace, and missing =.
Understand the +33.3% Base64 expansion math, Data URI overhead, Vercel 4.5MB and AWS 6MB/10MB payload limits, and when to switch to binary uploads.
Eliminate garbled characters (mojibake) when decoding Korean EUC-KR/CP949, Japanese Shift_JIS, Chinese GB18030, or Cyrillic Base64 payloads.
Cross-platform cheat sheet comparing GNU/Linux base64 -d -w0, macOS BSD base64 -D -i/-o, and Windows PowerShell [Convert]::FromBase64String.
Diagnose why decoded Base64 to PDF files open blank, corrupted, or upside down: 2MB Data URI caps, JSON \/ escapes, HTML 502 payloads, and text writes.
Convert Base64 columns in Excel without add-ins using Power Query Binary.FromText, Office Scripts, or VBA MSXML2, and avoid 32,767 cell truncation.