Skip to main content

File to Base64 Converter

Convert any file to a Base64 string right in your browser — get the raw Base64 or a ready-to-embed data URL for HTML, CSS or JSON.

Input

Drop a file or browse
One file · any type

The file is read locally — it is never uploaded.

Output

Base64 string
Was this helpful?

More ways to use this tool

Embed widget

<iframe
  src="https://iotools.cloud/embed/file-to-base64-encode/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="File to Base64 Converter — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Also available with

Guides

What does this converter do?

Drop in any file — an image, font, PDF, certificate — and get its contents as a Base64 string. Choose between the raw Base64 payload or a complete data URL (data:image/png;base64,…) you can paste straight into HTML src attributes, CSS url() values or JSON fields.

Common uses

  • Inlining small images or icons into HTML/CSS to avoid extra requests.
  • Embedding fonts or certificates in configuration files.
  • Preparing binary payloads for JSON APIs that only accept text.

How to use it

  1. Drop a file onto the uploader (or click to browse).
  2. Pick Base64 only or Data URL.
  3. Copy the result or download it as a text file.

Keep in mind Base64 output is ~33% larger than the original file — inlining is best for small assets.

Privacy

The file is read with your browser's FileReader and converted locally. It is never uploaded to any server.

base64fileconverterdata-url

Part of a workflow

All collections

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.