Some places only accept text — an HTML file, a stylesheet, a JSON config — but you still need a picture in there. Base64 turns an image into a long string of plain text that can sit inside code, and this tool makes that string for you in one click, telling you exactly how long it is and how much bigger it is than the original file.
Convert your first image
- Click “Choose an image” and pick a file. Any image works — PNG, JPG, WebP, a screenshot. The tool reads it straight into the browser and shows a preview of it.
- Read the line under the preview. It shows the file name, its size, and the size of the Base64 string — for example, a 17.9 KB PNG becomes a “Base64 string of 24,398 characters (+33%)”.
- Copy the string from the box below. The full data URL is in a text box, starting with something like
data:image/png;base64, — click “Copy Base64” to copy the whole thing, then paste it wherever you need it.
What the numbers mean
- Base64 is always about a third bigger than the file. Three bytes of image become four characters of text, so expect roughly +33% — that is the format, not a fault of the tool. Very small files show a little more (a 1.0 KB file came out at +36%) because the
data:image/png;base64, prefix at the front counts too.
- The prefix tells the browser what the file is. A PNG starts with
data:image/png;base64,, a JPEG with data:image/jpeg;base64, — keep the whole string, prefix included, or the image will not display.
- Use it for small images, not big photos. A logo, an icon or a tiny illustration is perfect for embedding. A 2 MB holiday photo becomes about 2.7 MB of text inside your page — at that size, linking to the image file is faster for visitors.
- Your image never leaves your device. The file is read by the browser itself and turned into text there — nothing is uploaded to a server.
- If nothing happens, pick a file first. Clicking anything before choosing an image shows “Choose an image first.”
One file in, one long string out — paste it into your code and the image travels with the file, no separate upload needed.