Image to Base64

Turn any image into a base64 string for embedding in CSS or HTML.

How Image to Base64 works

Convert an image to raw base64 or a data URL for inline use, with the size overhead shown. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.

That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.

What the output is

The file is read as a data URL and the tool returns the Base64 payload without the data:image prefix, which is the part you paste into a JSON field, a CSS url() or an API payload.

Because it is a direct encoding of the file bytes, the output is identical to what a server would compute — nothing is re-encoded and no quality is lost.

The 33% rule

Base64 encodes three bytes into four characters, so the output is about a third larger than the file. A 300 KB PNG becomes roughly 400 KB of text.

That matters because Base64 in a database column or a JSON response is often limited by size. Inlining an image in a CSS file also prevents it from being cached separately, so the page grows by the encoded size on every load.

File sizeBase64 sizeReasonable?
4 KB icon5.3 KBYes, inline it
50 KB logo67 KBBorderline
500 KB photo667 KBNo — use a URL
2 MB photo2.7 MBNo

Where inlining helps

Small icons, a single critical logo and SVG assets benefit, because one fewer request often beats the size cost. Above roughly 5–10 KB the request savings stop compensating for the transfer size.

If the Base64 is going into an email template, check the client first — several strip data URLs entirely, and the image silently disappears.

Good to know

  • Works offline once loaded, including on flights and in locked-down networks.
  • No file size limit beyond your device's own memory.
  • Free to use, with no account and no usage counter.
  • Results are produced locally, so they are not logged or shared with anyone.

Questions

Does base64 make files bigger?

Yes, roughly 33% larger than the binary original, because of the encoding overhead.

When should I inline an image?

Only for very small icons — large images block HTML parsing.

Does it include the data:image prefix?

No, only the payload. Add the prefix yourself if the field needs a full data URL.

Is the image uploaded?

No. The file is read locally with a FileReader.

Keep going

More image tools