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)
Drop any image, SVG, WOFF2 font, audio clip, or PDF to generate a verified data:<mime>;base64,... URI with exact magic-byte MIME detection.
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.
Drop any local file up to 100MB+ or type UTF-8 text on the left. No data leaves your browser.
Load real client-side verified payloads straight into the workbench above. Zero third-party trademarks.
Ensure every generated Data URI carries an exact IANA-registered media type verified from binary headers rather than fragile file extensions.
The RFC 2397 Data URL scheme follows a strict grammar: data:[<mediatype>][;base64],<data>. When developers construct strings manually or use extension-only helpers, subtle mistakes cripple rendering—forgetting the ;base64 token, emitting image/jpg instead of image/jpeg, or assigning application/octet-stream to a WOFF2 webfont.
Base64Doc evaluates the file’s actual header octets across 66 signatures—identifying WOFF2 (77 4F 46 32 -> font/woff2), SVG (<svg -> image/svg+xml), WebP (RIFF...WEBP -> image/webp), MP3 (ID3 -> audio/mpeg), and Office OOXML manifests—so every Data URI matches browser expectations.
Bundle small WOFF2 glyph subsets, inline icons, and audio cues into standalone HTML demos or browser extensions without external requests.
Single-file printable reports, offline documentation bundles, and browser bookmarklets benefit hugely from self-contained Data URIs because assets never fail due to CORS headers or offline networks. Copying the CSS tab builds clean @font-face or background-image declarations in one step.
For multi-megabyte documents like PDFs inside iframes, remember that top-level URL parsers cap data: strings around 2 MB—making Blob URLs mandatory during decoding.
Switch to Decode mode at any time to audit third-party Data URIs and repair wrong mediatype headers automatically.
Beyond generation, pasting an existing Data URI into Decode mode strips the header, checks underlying magic bytes, and surfaces any conflict immediately with a repaired prefix.
Select any local asset from disk or paste raw text/SVG markup; all bytes remain inside your browser Web Worker with zero server upload.
Instead of trusting filename extensions blindly, Base64Doc checks 66 binary signatures (such as 77 4F 46 32 for font/woff2) to set the true MIME header.
Generate a clean single-line Data URI free of embedded newlines, quotes, or whitespace that break CSS url(...) and HTML src attributes.
Grab the bare Data URI string or switch to CSS, HTML, Markdown, or JavaScript tabs ready to drop into self-contained web builds.
| Capability | Base64Doc Behavior | Engineering Notes |
|---|---|---|
| RFC 2397 Syntax | data:[<mediatype>][;base64],<data> | Empty mediatype defaults to text/plain;charset=US-ASCII per spec. |
| Detected Asset Classes | Images, WOFF/WOFF2, PDF, Audio, SVG | 66 signatures plus OOXML XML classification verify the exact MIME type. |
| Browser Navigation Cap | ~2 MB in top-level/iframe URLs | CSS @font-face and <img> handle larger URIs better than <iframe> PDFs. |
| Line Break Policy | Single-line (MIME-76 off) | RFC 2397 URLs inside CSS/HTML should omit CRLF line wrapping. |
| Overhead Formula | Prefix (22–85 B) + ceil(N/3)*4 | Live readout displays exact final character count and byte footprint. |
A Data URI prepends data:<mime-type>;base64, ahead of raw Base64 characters so browsers and CSS engines know whether to decode an image, font, audio clip, or PDF.
Yes, pasting a mismatched Data URI into Decode mode inspects the underlying magic bytes and constructs the corrected data:<real-mime>;base64, header automatically.
Yes, dropping .woff2 (77 4F 46 32) or .ttf (00 01 00 00) fonts detects font/woff2 or font/ttf accurately for @font-face src: url(...) CSS rules.
No, omit 76-character line wrapping for RFC 2397 Data URIs embedded in HTML or CSS attributes; extra newlines can break URL parsers.
Per RFC 2397, omitting the media type defaults to text/plain;charset=US-ASCII, causing browsers to refuse rendering binary images or fonts.
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.