Loading tool…
Setting up your workspace on this device.
Convert images to Base64 string.
Loading tool…
Setting up your workspace on this device.
Advertisement
Image to Base64 converts an image file into a Base64 string you can paste straight into code. Choose a PNG, JPG, WebP, GIF, SVG or other image and you get two outputs: the raw Base64 text, and a complete data URL that starts with data:image/…;base64, ready for an img src, a CSS background or a JSON field. Copy either one with a click, or download the raw string as a .txt file. The length of each output is shown, so you can judge whether inlining is worth it. Encoding happens in your browser, so the image never leaves your device.
Choose an image
Drop any image file into Image file. It is encoded as soon as it loads.
Pick the output
Use Copy raw Base64 for the encoded text alone, or Copy data URL for the version with the data:image prefix.
Save if needed
Press Download Base64 TXT to keep the raw string as a text file.
Raw Base64 is just the encoded characters. A data URL adds a prefix such as data:image/png;base64, with the right image type, so browsers can use it directly in src or url().
Base64 stores every 3 bytes as 4 text characters, so the output is about a third larger than the original file. That is why it suits small images such as icons rather than photos.
Paste it as the value of an img tag’s src attribute, or inside url() for a CSS background-image.
Yes. Image to Base64 is completely free, with no account, no paywall, and no usage limits.
No. Image to Base64 works instantly in any modern web browser — there is no software to install, no extension, and no sign-up.