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)
Paste JSON objects or upload .json files to generate clean UTF-8 Base64 or unpadded URL-Safe tokens with instant code snippets and size checks.
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.
Encode international customer names, currency symbols, and emoji inside JSON cleanly via UTF-8 byte streams instead of crashing native window.btoa().
JavaScript’s legacy window.btoa() expects binary strings whose character codes stay strictly within 0–255 (Latin1). The instant a JSON payload contains a Korean syllable, Japanese character, euro sign, or emoji, btoa(JSON.stringify(obj)) throws DOMException: The string to be encoded contains characters outside of the Latin1 range.
Base64Doc encodes every text input through TextEncoder("utf-8") into a real Uint8Array byte buffer before running chunked Base64 translation—matching Python, Go, and Node.js Buffer.from(str, "utf8").toString("base64") behavior identically.
Generate unpadded Base64URL tokens from JSON state objects so query parameters never corrupt + into spaces or split on =.
Passing Base64-encoded JSON pagination cursors or OAuth state in URLs breaks when standard + turns into a space inside form-urlencoded query strings and trailing = confuses query splitters. Toggling URL-Safe and Omit Trailing = produces clean header- and URL-safe Base64URL immediately.
Drop multi-megabyte .json fixture files directly into the Web Worker encoder with virtualized preview and gateway size alerts.
Whether preparing a Kubernetes config map or encoding mock webhook bodies for CI, removing indentation spaces before encoding trims 15%–35% off final Base64 length.
Insert formatted or minified JSON strings—even objects containing Korean, Japanese, Arabic, or emoji characters—or choose a local .json file.
Base64Doc serializes text with TextEncoder into UTF-8 octets prior to chunked Base64 encoding so Unicode code points above U+00FF never fail.
Toggle RFC 4648 §5 (-_) and Omit Trailing = when placing encoded JSON inside query strings, cookies, or X-Custom HTTP headers.
Copy the Base64 string or switch to JavaScript, Python, Go, or PowerShell tabs showing exact UTF-8-safe encoding idioms.
| Capability | Base64Doc Behavior | Engineering Notes |
|---|---|---|
| Unicode Safety | TextEncoder UTF-8 (No btoa bug) | Handles emoji and CJK values without InvalidCharacterError exceptions. |
| Cursor / Header Format | RFC 4648 §5 + No = Padding | Prevents +, /, and = from breaking URL query parameter parsing. |
| Whitespace Trade-Off | Minified JSON saves 15%–35% | Compact single-line JSON avoids encoding indentation spaces as Base64. |
| Output Prefix | eyJ... (for {"...}) | Standard JSON object encodings open cleanly with eyJ. |
| Client Privacy | 100% browser-local RAM | Service-account manifests and OAuth state objects stay on-device. |
Native window.btoa() accepts strictly Latin1 code points (0–255) and throws DOMException on characters above U+00FF. Base64Doc runs TextEncoder UTF-8 serialization first so multi-byte scripts encode cleanly.
Yes, enable RFC 4648 §5 URL-Safe and Omit Trailing = to generate URL-safe Base64URL strings free of +, /, and =.
Yes, every indentation space and newline in pretty-printed JSON gets encoded verbatim, typically adding 15%–35% extra Base64 characters.
No, Base64 is reversible encoding rather than encryption; anyone can decode eyJ... tokens locally, so sign or encrypt sensitive claims with JWS/JWE or keep secrets server-side.
No, encoding executes 100% locally in browser memory with zero network transmission.
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.