Skip to main content
Image

Image to Base64

Convert a JPG, PNG, or WebP image into a Base64-encoded string or data URI, directly in your browser — for embedding in CSS, HTML, or JSON.

Drop your image here or choose a file. Accepts JPEG, PNG, and WebP.

You can also paste an image with Ctrl+V / Cmd+V.

Your images are processed directly in your browser — they are never uploaded to a server.

About Image to Base64

Convert a JPG, PNG, or WebP image into a Base64-encoded string directly in your browser — useful for embedding a small image straight into CSS (background-image: url(...)), HTML (<img src="...">), or JSON without a separate file request.

Base64 encoding turns binary data into text, which adds roughly 33% to the size — worth keeping in mind for larger images. Nothing is uploaded; the encoding happens entirely on your device.

Frequently asked questions

Do my images get uploaded anywhere?+

No — encoding happens entirely in your browser using the FileReader API already built into it. Your image is never sent to a server.

What’s the difference between the two output options?+

With the prefix included, you get a full data URI (`data:image/png;base64,...`) ready to drop straight into an `<img src>`, a CSS `background-image: url(...)`, or JSON. Without it, you get just the raw Base64 payload, useful when your own code will add the appropriate wrapper.

Why is the Base64 output bigger than my original file?+

Base64 encodes binary data as text using only 64 printable characters, which takes roughly 4 bytes of text for every 3 bytes of binary data — about a 33% size increase. This is expected and unavoidable for any Base64 encoding, not specific to this tool.

Is this tool free?+

Yes, completely free with no sign-up.

Related tools