ToolsCrate

File to Base64 Converter

Turn any file into Base64 text or a ready-to-paste data URI — and convert it back to a file again.

Everything happens in your browser, so even large files stay on your device. Data URIs let you embed a file directly in HTML or CSS without a separate request — useful for small icons, wasteful for anything large.

How to use

  1. 1Drop any file onto the box to convert it.
  2. 2Copy the raw Base64, or copy it as a data URI ready to paste into CSS or HTML.
  3. 3To go the other way, paste Base64 or a data URI into the decode box.
  4. 4Download the reconstructed file.

Frequently Asked Questions

What is a data URI?

A way of embedding a file directly in HTML or CSS, as data:[mime];base64,[data]. The browser treats it as a real file with no separate request. Handy for small icons, wasteful for anything large.

Why does Base64 make my file bigger?

It encodes every three bytes as four characters, so the result is about 33% larger. That overhead is the price of representing binary data as safe text.

Is there a file size limit?

Only your device's memory, though very large files produce enormous strings that are awkward to paste anywhere. Above a megabyte or so, a data URI is rarely the right tool.

Can I decode a full data URI?

Yes. Paste the whole thing including the data:...;base64, prefix and it is stripped automatically before decoding.

When should I actually use a data URI?

For small assets — icons, a tiny background image, an inline font subset. It saves a network request, but the roughly 33% size increase and the fact that it cannot be cached separately make it a poor choice for anything large.

Does the Base64 look different from what my server produces?

It should be identical for the same bytes. If it differs, the usual cause is line wrapping: some tools break Base64 into 76-character lines, which is valid but changes the raw string.