DengWoLai DengWoLai
Dev · DengWoLai

Image to Base64 (Data URI Generator)

Image to Base64 encodes a picture into a data URI you can paste into CSS or HTML. Base64 inflates size by about 33%, so it only pays off for very small assets where removing a request beats the extra bytes.

Runs locally · files stay on device · works offline

How it works in 4 steps

  1. 1

    Pick or drop

    Select or drag files into the card — loaded directly into local memory.

  2. 2

    Set options

    Adjust target KB, format, dimensions or filters with instant feedback.

  3. 3

    Process locally

    Canvas, WebAssembly, or Web Crypto completes the job on your device.

  4. 4

    Save result

    Download directly; close the tab to clear everything from memory.

When to use this

Scenario Recommended Why
A tiny icon needs zero extra requests Image to Base64 Inlining beats a round trip under ~2KB
An email template must be self-contained Image to Base64 No external asset to block
The image is a hero banner Keep it a file Base64 adds 33% and blocks HTML parsing

Privacy & Offline Guarantee

Ready to use with zero installation or login. Once loaded once, core dependencies cache locally so the tool works offline.

FAQ

When is inlining worth it?

Roughly under 2KB, and only for critical above-the-fold assets. Beyond that the 33% size penalty and the loss of caching cost more than the request saved.

Why is the Base64 string bigger than the file?

Base64 maps 3 bytes to 4 characters, a fixed 33% overhead. Compression cannot recover it.

Is my image uploaded?

No — encoding uses FileReader locally.

Something failed, or you wish this tool also did something else? Tell me →

Related Tools

Dev
URL Encoder / Decoder
Percent-encode URLs — see both encoder variants.
Local only →
Dev
HTML Escape / Unescape
Escape HTML entities so text shows literally.
Local only →
Dev
JSON to YAML and Back
Convert between JSON and YAML — config never uploaded.
Local only →
Dev
UUID Generator — v4 and v7
Generate UUID v4 or v7 in bulk — cryptographically random.
Local only →

Ready to process your files privately?

Back to tool ↑