Base64Doc

Encode JPEG Photos to Base64 Locally

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

Encode high-resolution .jpg and .jpeg photos without server uploads, downscale width before encoding, and inspect +33.3% payload expansion.

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)

Verbatim Byte Encoding vs Opt-In Canvas Resizing & EXIF Stripping

Preserve original JPEG bytes and EXIF tags by default, or toggle browser resizing to bake orientation and strip GPS metadata while slashing size.

Read full technical details

When writing automated tests against image-forensics APIs or archiving receipt scans, altering JPEG quantization tables or stripping EXIF timestamps invalidates checksums. In default mode, Base64Doc reads raw .jpg bytes directly off disk so every encoded octet matches the original file byte-for-byte.

Conversely, mobile camera photos captured for support tickets or KYC forms often measure 4000x3000 pixels and embed multi-kilobyte GPS and lens metadata. Toggling Pre-Encode Slimming re-renders the image onto a capped-width browser canvas—automatically baking EXIF orientation flags upright, stripping privacy-sensitive GPS tags, and cutting byte weight dramatically.

Keeping Mobile Camera JPEGs Below 4.5 MB Serverless Limits

Downscale bulky 4–8 MB smartphone JPEGs before +33.33% Base64 expansion triggers HTTP 413 gateway rejections.

Read full technical details

A typical 4 MB smartphone photo balloons to 5.33 MB once Base64-encoded, failing Vercel Serverless Functions (4.5 MB cap) and pushing close to AWS Lambda proxy caps (6 MB). Scaling Max Width to 1280 px or encoding to WebP beforehand usually brings the final Base64 string well under 400 KB.

Zero-Exposure Privacy for Personal Photos & Scanned IDs

Encode driver licenses, passport scans, and field inspection photos entirely offline inside a local Web Worker.

Read full technical details

Every encoding step executes in local RAM without posting pixels or EXIF metadata to external servers, and outputs ready-to-paste JSON wrappers or cURL/Python/JS code snippets.

Step-by-Step Local Workflow

STEP 1

Pick a Local .jpg or .jpeg Photo

Drag any camera photo or product image into the encoder; files stream locally through your browser Web Worker with zero server upload.

STEP 2

Choose Verbatim Bytes or Pre-Encode Resize

Leave slimming off to encode exact disk bytes (preserving EXIF orientation and metadata), or enable Max Width / WebP conversion to shrink 12 MP camera files.

STEP 3

Verify Gateway Green/Red Payload Budget

Confirm the +33.33% encoded byte size stays green beneath Vercel 4.5 MB or AWS 6 MB limits before pasting into REST tests.

STEP 4

Copy Data URI, JSON Body, or Code Template

Grab the canonical image/jpeg Data URI, JSON payload wrapper, or copy-ready Python, JavaScript, Go, or PowerShell code.

Technical Specification Summary

CapabilityBase64Doc BehaviorEngineering Notes
Verbatim Mode BehaviorPreserves EXIF & DCT blocksNo quality loss or metadata stripping unless pre-encode slimming is toggled.
Slimming Mode BehaviorBakes EXIF rotation + strips GPSBrowser canvas re-encoding auto-orients pixels and removes camera EXIF.
Camera Payload Math3.35 MB JPG -> ~4.47 MB Base64Modern 48 MP smartphone photos routinely breach serverless body limits.
Canonical Prefixdata:image/jpeg;base64,/9j/...Always emits standards-compliant image/jpeg rather than image/jpg.
Privacy Guarantee0 network upload bytesSensitive EXIF GPS coordinates and IDs remain strictly on-device.

Frequently Asked Questions

How do I shrink a 5 MB JPEG photo so its Base64 payload fits inside a 4.5 MB API limit?

Use the Pre-Encode Slimming bar to cap Max Width (such as 1280 px) or convert to WebP before generating the Base64 string, watching the gateway light turn green.

Are EXIF metadata headers preserved when encoding raw JPEG bytes directly?

Yes, verbatim mode converts the exact file bytes untouched. Only when you enable Pre-Encode Slimming are pixels redrawn via browser canvas, which bakes orientation and strips EXIF tags.

Why does Base64Doc output data:image/jpeg even if my file ends in .jpg?

Official IANA media registration defines image/jpeg as the sole standard MIME type for both .jpg and .jpeg extensions.

Does encoding a JPEG to Base64 reduce image sharpness?

No, Base64 is a lossless ASCII transport representation of your exact JPEG bytes; visual quality never changes unless you actively apply canvas resizing.

Can I wrap the encoded JPEG inside a JSON request body immediately?

Yes, switch to the JSON Payload snippet tab or click Copy API JSON Request Body to grab a formatted payload.

Explore All 34 Base64 Converters & Developer Tools