Image Base64 Converter

Turn any image into a data URL you can inline in CSS or HTML — original vs encoded size shown so you can judge the cost.

Image Tools Runs in your browser · no upload

Reviewed 17 November 2026 · Free · No account needed

ExecutionYour browserInput never leaves your tab
File retentionNoneNothing is stored
AccountNot requiredNo sign-up, no paywall
PriceFreeNo trial, no usage cap on the tool itself

How to use

  1. Choose the image file.
  2. The data URL generates immediately with a size comparison.
  3. Copy it into your CSS (background) or HTML (img src).

Example

Input: 12 KB icon

Output: data:image/png;base64,… · ~16 KB encoded (+33%)

How it works

The image file is read as bytes and encoded to Base64, prefixed with a data URI so it can be pasted directly into HTML or CSS.

The file is read as a data URL (FileReader.readAsDataURL) — the original bytes are Base64-encoded as-is and prefixed with data:image/…;base64,. Nothing is decoded or re-encoded, so the output preserves the file's own format.

Worked example

A 12 KB icon becomes a data:image/png;base64,… string of about 16 KB (+33%), with both sizes shown side by side.

Edge cases to know

  • Base64 inflates binary size by about a third — the comparison is shown so you can judge the cost.
  • The original encoding is preserved; no format conversion happens.
  • Data URLs bypass HTTP caching, which suits small, rarely-changing assets.

Limits & compatibility

  • Base64 inflates binary size by ~33% — shown so you can judge.
  • Data URLs bypass HTTP caching — best for small, rarely-changing assets.
  • Output preserves the original encoding (the file's own format).

Privacy

Encoding happens locally in your browser. The file is never uploaded or stored.

Related tools

FAQ

Questions about Image Base64 Converter

What does the tool produce?

A Base64 data URL — the whole image encoded as text — that you can inline directly in CSS (as a background) or HTML (as an img src). It generates as soon as you choose the file, entirely in your browser, with a copy-ready string and both the original and encoded sizes shown.

Why is the encoded version bigger than my file?

Base64 encoding inflates binary data by roughly a third — a 12 KB icon becomes about 16 KB as a data URL. The tool shows both sizes side by side so the cost is explicit. That overhead is the price of never making a separate file request.

When should I inline an image as Base64?

For small, rarely-changing assets: icons, logos, tiny placeholders. Data URLs bypass the browser's HTTP caching, so a large or frequently updated image would be re-downloaded with every page load instead of being cached once. For anything bigger, a normal image file with caching usually serves users better.

Does the format of my image change?

No. The output preserves the file's own encoding — a PNG stays image/png inside the data URL, a JPEG stays image/jpeg. Nothing is re-encoded, resized or optimised along the way; the bytes are simply translated into Base64 text, one for one.