Base64 File Converter
Convert any file to Base64 or a ready-to-paste data URI in your browser. Built for embedding images as data URIs in HTML, CSS, and JSON.
File to Base64Data URIClient-sideFree to use
Drag a file here, or pick one to encode
Any file type works. Limit 10.00 MB. Files never leave your browser.
How to use
- Choose a file. Drag a file onto the drop zone or pick one from your device. Any file type works (up to 10 MB).
- Pick the output format. Use raw Base64 for storage and APIs, or grab the data URI for inline images and CSS.
- Copy or download. Copy the Base64 / data URI straight to your clipboard, or save the encoded text as a .txt file.
Common use cases
- Embedding an image as a data URI in HTML, CSS, or Markdown
- Encoding a small binary asset (icon, font, certificate) for an env var or secret
- Passing file contents over JSON when multipart uploads are not an option
- Producing inline favicons or SVG sprites without an extra HTTP request
Frequently asked questions
- What is a data URI and when should I use one?
- A data URI embeds file content directly into a string using the format data:mime/type;base64,XXXX. Use it for tiny images, icons, or fonts you want inline in HTML, CSS, or Markdown without a separate HTTP request.
- Is there a file size limit?
- Yes. The page caps single uploads at 10 MB to keep the browser responsive. Above that, encoding can stall the tab and the resulting data URI becomes too large to be useful for embedding.
- Does my file get uploaded to a server?
- No. The browser reads the file via FileReader and encodes it locally in memory. Nothing is uploaded, transmitted, or persisted anywhere.
- Why are data URIs so much larger than the original file?
- Base64 expands binary by about 33% (3 bytes become 4 ASCII characters), and the data URI prefix adds a few more bytes. For images over a few KB, a normal <img src> URL is usually faster.
- Which file types work best as data URIs?
- Small SVGs, icons, web fonts under 50 KB, and tiny PNG sprites benefit most. Avoid data URIs for photos, large illustrations, or anything that should be cached separately by the browser.
Related tools
How to use
- Choose a file. Drag a file onto the drop zone or pick one from your device. Any file type works (up to 10 MB).
- Pick the output format. Use raw Base64 for storage and APIs, or grab the data URI for inline images and CSS.
- Copy or download. Copy the Base64 / data URI straight to your clipboard, or save the encoded text as a .txt file.
Common use cases
- Embedding an image as a data URI in HTML, CSS, or Markdown
- Encoding a small binary asset (icon, font, certificate) for an env var or secret
- Passing file contents over JSON when multipart uploads are not an option
- Producing inline favicons or SVG sprites without an extra HTTP request
Frequently asked questions
- What is a data URI and when should I use one?
- A data URI embeds file content directly into a string using the format data:mime/type;base64,XXXX. Use it for tiny images, icons, or fonts you want inline in HTML, CSS, or Markdown without a separate HTTP request.
- Is there a file size limit?
- Yes. The page caps single uploads at 10 MB to keep the browser responsive. Above that, encoding can stall the tab and the resulting data URI becomes too large to be useful for embedding.
- Does my file get uploaded to a server?
- No. The browser reads the file via FileReader and encodes it locally in memory. Nothing is uploaded, transmitted, or persisted anywhere.
- Why are data URIs so much larger than the original file?
- Base64 expands binary by about 33% (3 bytes become 4 ASCII characters), and the data URI prefix adds a few more bytes. For images over a few KB, a normal <img src> URL is usually faster.
- Which file types work best as data URIs?
- Small SVGs, icons, web fonts under 50 KB, and tiny PNG sprites benefit most. Avoid data URIs for photos, large illustrations, or anything that should be cached separately by the browser.