Free Data URI Generator (File to Base64)
Convert a file or image into a Base64 data URI · ready to inline into HTML, CSS, or JSON. The file is read locally and never uploaded.
100% client-side · nothing you enter is ever sent to a server or stored.
Preview · sign in with a free account to run it
How to use it
- Choose File → data URI and pick a file up to 10 MB, or Text → data URI and paste text, HTML, JSON or SVG.
- Check or change the MIME type and the encoding.
- Copy the data URI into an src, a CSS url() or JSON.
Example
Input
Text → data URI · MIME text/plain hello world
Result
data:text/plain;charset=utf-8;base64,aGVsbG8gd29ybGQ=
When inlining helps
- Small icons and placeholders
- Inlining a tiny image saves a request.
- Large files
- Base64 makes files about a third larger, and inlined data can't be cached separately. Keep big images as normal files.
- SVG
- SVG can often be inlined as text, without Base64, which is smaller.
- Content-Security-Policy
- data: URLs must be allowed in the matching directive (usually img-src) or the browser blocks them. Never allow data: in script-src.
Go deeper
Page updated
Frequently asked questions
When should I inline a file as a data URI?
For tiny assets (under ~4 KB) that block rendering · small icons, inline SVG fallbacks, favicons in single-file pages. Inlining removes a network round-trip but bloats the document by ~33%, so keep it for small files.
Is my file uploaded to convert it?
No · the FileReader API reads the file inside your browser and produces the Base64 string locally. Nothing is transmitted or stored.
Is my file uploaded?
No. The file is read and encoded in your browser and never leaves your device.
Want the full picture?
This tool covers one narrow check. A full SimplyScan runs 60 checks across 14 categories · exposed keys, RLS, XSS, auth, and speed · in 30 seconds.
Run a full security scanRelated tools
Password Generator
Generate strong, cryptographically random passwords · choose the length and character sets, then copy with one click.
UUID Generator
Generate UUID v4 or time-ordered v7 identifiers · single or in bulk · using the browser's cryptographic random source.
API Key Generator
Generate random API keys and secrets · hex, base64url, or alphanumeric, with an optional prefix · straight from your browser's CSPRNG.