# Base64 File Guide

Turn any file into a Base64 data string, or decode one back to a file.

- Tool: https://ilham.dev/tools/base64-file-converter/
- Guide URL: https://ilham.dev/guides/base64-file-converter/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Browser File Tools (https://ilham.dev/guides/browser-file-tools/)

## What it does

Turn any file into a Base64 string, or a Base64 string back into a file. It is most useful for embedding a small image or font directly in a stylesheet as a data URI, or for working out what a data URI you were handed actually contains. The file is read locally through the File API.

## Use the tool

Open https://ilham.dev/tools/base64-file-converter/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Encoding.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

### Is there a size limit?

Whatever your browser can hold in memory. Base64 inflates a file by about a third, so a 3 MB image becomes roughly 4 MB of text.

### Should I embed images as data URIs?

Only for small files. A data URI cannot be cached separately from the stylesheet it lives in and it has to be parsed along with it, so anything past a few kilobytes is usually better served as an ordinary file.