Skip to content
Private by design — every tool runs on your device · No upload · No watermark · No account
P pixelshift.
Instant encoding · nothing uploaded — 100% in your browser

Image to Base64.
Paste-ready output.

Encode any image as a data URL the moment you drop it in — with or without the prefix, wrapped or single-line. Copy it straight into HTML, CSS or JSON. The file never leaves your device.

No uploads Instant No watermark No sign-up
1 Upload 2 Encode 3 Paste
100% local

Output

Drop images here

or browse files · PNG, JPG, WEBP, GIF

Batch supported · paste works too (Ctrl+V) · nothing is uploaded

Add an image to get started — nothing is uploaded.

01 / How it works

Drop it,
paste it.

01

Add

Add an image — encoding starts instantly

02

Tune

Choose whether to include the data URL prefix

03

Copy

Copy the string or download it as a .txt file

04

Paste

Paste it into your HTML, CSS or JSON

base64 · prefix on
lossless

Every 3 bytes become 4 characters — the string is ~33% larger, the bytes identical:

10 KB image ≈ 13.4 KB · 13,7xx chars
100 KB image ≈ 134 KB · single line
Decoded back byte-identical file
Uploads zero — FileReader only
Quality unchanged
Copy string

02 / Questions

Base64, answered

How do I convert an image to Base64?

Add your image and the encoding appears instantly — the tool reads the file directly in your browser and never uploads it. Copy the result or download it as a .txt file.

What is the data URL prefix and when do I need it?

The prefix (data:image/png;base64,) tells the browser how to interpret the string. Keep it for direct use in HTML img src, CSS url() or as a standalone URL. Turn it off when you only need the raw Base64 body — for example inside a JSON field that already declares the type.

Why is the Base64 string larger than my image?

Base64 encodes every 3 bytes into 4 characters, so the result is about 33% larger than the source file. That's the standard trade-off for embedding binary data in text formats.

What can I do with the encoded string?

Embed images inline in HTML (img src), reference them in CSS (background-image: url(...)), carry them inside JSON payloads, or store them in text-based configs — anywhere a URL or text field is accepted.

What does the wrap-lines option do?

By default the string is one continuous line. Wrapping at 76 or 80 characters inserts line breaks for readability in code reviews and version control — the breaks are valid whitespace inside data URLs when used in HTML/CSS attributes, but remove them for strict JSON use.

Is there a size limit?

Files up to 50 MB are accepted, but remember Base64 grows by ~33% and very large strings can slow down text editors and page loads. For production pages, images above a few hundred KB are usually better served as separate files.

Does encoding change my image?

No — Base64 is a lossless text representation of the exact same bytes. Decode it back and you get a byte-identical file.

Is my image uploaded anywhere?

No — the file is read locally by your browser's FileReader API and encoded in memory. Nothing ever leaves your device.

Base64 in real projects

Base64 data URLs are handy for small inline assets, icons and JSON payloads, but they make files about a third larger. Use this tool when the convenience matters more than the bytes. For debugging an image before encoding, open metadata viewer; for format changes, use convert format.