Advertisement

PNG to Base64 converter

Convert PNG to Base64 free in your browser. Encode your image as a data URL string for HTML, CSS and APIs.

Convert your PNG

Drop a PNG file or click to browse. Everything runs locally in your browser.

Drop PNG file here
or click to browse
Good to know: The output is a data URL string, roughly 33% longer than the original file.
Pick a file to start.
Advertisement

What a data URL is

A data URL packs a whole file into a text string, starting with something like data:image/png;base64,. Paste it into an image src, a stylesheet or a JSON payload and the image works with no separate file or request.

What happens when you convert

Your PNG file is read locally and encoded to Base64 text, which appears below with a Copy button. Expect the string to run about 33 percent longer than the original file.

PNG to Base64 FAQs

What exactly do I get?
A data URL string like data:image/png;base64,.... It contains the whole file as text and can be pasted into an <img> src, CSS or JSON.
Why is the string longer than the file?
Base64 encoding adds about 33 percent overhead, so a 300 KB image becomes roughly 400 KB of text.
How do I use the Base64 output?
Paste it as an image src in HTML, into a stylesheet as a background, or into any API field that accepts data URLs. The Copy button grabs the whole string.
Is there a size limit?
Very large images make very long strings that can slow down editors. For web use, keep source images under a few megabytes.
Are my files uploaded to a server?
No. The conversion runs entirely in your browser with local code. Your files never leave your device.
Advertisement