Base64Doc

Encode PNG Files to Base64 & Data URIs

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

Paste clipboard screenshots with Ctrl/Cmd+V or drop PNG files to generate clean Base64, downscale large assets, and export CSS or React-ready snippets.

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
Encoded Base64, Gateway Budget & Code Snippets Appear Here

Drop any local file up to 100MB+ or type UTF-8 text on the left. No data leaves your browser.

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)

Zero-Temp-File Clipboard Screenshot to Base64 Encoding

Capture an area screenshot on macOS or Windows and press Ctrl/Cmd+V straight into the workbench to copy clean Base64 without saving temporary PNG files.

Read full technical details

Engineers authoring Playwright fixtures, Slack webhook cards, or single-file HTML bug reports often take quick screen captures purely to obtain a Data URI. Saving screenshot.png to Desktop, browsing for it in a file dialog, and deleting it afterward adds tedious friction.

Focusing the Base64Doc dropzone and pressing Ctrl+V or Cmd+V reads the raw image/png blob directly from the browser Clipboard API. Within a fraction of a second, the virtualized Base64 string, Data URI, and CSS/HTML wrappers appear ready to copy.

When Lossless PNG Outperforms WebP—and When to Compress

Keep razor-sharp monochrome icons in lossless PNG while converting heavy HiDPI UI screenshots to WebP before Base64 adds +33.33%.

Read full technical details

Flat vector-style UI icons under 4 KB with limited palettes compress tightly inside PNG IDAT chunks; re-encoding them as lossy WebP rarely saves space and risks slight chroma softening around crisp 1 px lines.

Conversely, full-screen photographic screenshots or 2x Retina captures routinely balloon to 2–6 MB as PNGs—becoming 2.7–8 MB once Base64-encoded. Enabling Pre-Encode max-width scaling and WebP compression inside Base64Doc drops those payloads into the green zone immediately.

Clean Data URI, CSS & Email Integration Trade-Offs

Export formatted CSS background rules and React/HTML image tags while knowing where inline Data URIs work best.

Read full technical details

Modern browsers, SVG renderers, and headless PDF generators (such as Chromium Puppeteer or Playwright) render data:image/png;base64 reliably with zero external network fetches. For HTML marketing emails where certain webmail clients strip Data URIs, export raw RFC 4648 Base64 or MIME-76 blocks to attach via Content-ID (cid:) headers instead.

Step-by-Step Local Workflow

STEP 1

Drop a .png File or Paste Clipboard Screenshot

Drag local PNG icons or press Ctrl/Cmd+V after taking an OS screenshot; Base64Doc captures the raw PNG bytes right from the clipboard event.

STEP 2

Decide Between Lossless PNG or Pre-Encode WebP

Keep tiny crisp UI icons as lossless PNG; for large multi-megabyte retina screenshots, toggle WebP compression in the Pre-Encode bar to slash payload weight.

STEP 3

Check Gateway Budget & Alphabet Settings

Verify the encoded byte size against Vercel 4.5 MB and AWS 6 MB thresholds, and toggle Raw Base64 vs data:image/png;base64 Data URI mode.

STEP 4

Copy CSS, HTML, or Code Snippets

Switch to the CSS, HTML, Markdown, or JSON tab to copy formatted snippets straight into stylesheets, tests, or documentation.

Technical Specification Summary

CapabilityBase64Doc BehaviorEngineering Notes
Clipboard Image FlowClipboardEvent.items -> BlobEncodes screenshots directly without cluttering your Desktop folder.
PNG Output PrefixiVBORw0KGgo... (image/png)Lossless Deflate IDAT bytes preserved verbatim when slimming is off.
Retina Screenshot SavingsWebP / Max-Width SlimmingCuts 2x HiDPI desktop screenshots by 60%–85% before Base64 expansion.
Email Client CaveatData URI vs CID attachmentNote that several desktop mail clients block inline data:image/png URIs.
Worker Memory Model786 KB aligned chunksHandles large 50 MB+ PNG textures smoothly via virtualized preview.

Frequently Asked Questions

Can I press Ctrl/Cmd+V with a screenshot on my clipboard instead of saving a PNG first?

Yes, focusing the workbench and pasting an image from your OS clipboard reads the raw image/png blob and encodes it directly into Base64 and Data URI snippets.

When should I convert a PNG to WebP before Base64 encoding?

Convert large UI screenshots or photographic PNGs to WebP whenever raw size exceeds ~100 KB or triggers yellow/red API gateway warnings, while keeping tiny sharp icons as lossless PNG.

Why does encoding a PNG into Base64 make my stylesheet larger than the original PNG?

Base64 maps 3 binary bytes into 4 ASCII characters (+33.33%), though HTTP Gzip or Brotli compression on the serving stylesheet recovers a small fraction of that overhead.

Do all email clients display data:image/png;base64 tags inside HTML messages?

No, several major webmail and desktop mail clients strip inline Data URI images for security; use standard MIME cid: attachments when targeting broad email compatibility.

Does encoding a PNG strip its alpha transparency or color profile?

No, raw encoding converts the exact file bytes verbatim, preserving alpha transparency, ICC color profiles, and pHYs DPI chunks intact.

Explore All 34 Base64 Converters & Developer Tools