About this tool
File to Base64 converts any file — image, PDF, font or document — into a Base64 data string (data URI) that you can embed directly in HTML, CSS, JSON or code. This avoids extra network requests and is useful for icons, email templates and API payloads. The conversion happens entirely in your browser, so your file is never uploaded.
How to use
- 1Upload any file.
- 2The Base64 (data URI) is generated instantly.
- 3Copy the string for your code.
Benefits
- Works with any file type.
- Outputs a ready data URI.
- Private — nothing is uploaded.
Frequently asked questions
What is a data URI?+
It is a way to embed file contents directly in code using a Base64 string, avoiding a separate file request.
Is there a size limit?+
Very large files produce very long strings and are impractical to embed, so keep files reasonably small.