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.
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.
Add
Add an image — encoding starts instantly
Tune
Choose whether to include the data URL prefix
Copy
Copy the string or download it as a .txt file
Paste
Paste it into your HTML, CSS or JSON
Every 3 bytes become 4 characters — the string is ~33% larger, the bytes identical:
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.