File to Base64
Turn an image, font or any file into a Base64 string, data URI, CSS snippet or HTML tag that you can embed straight into code.
Loading tool...
Runs in your browser. Nothing is sent anywhere.
When to use it
A good fit for developers and email marketers who need to embed an icon, small logo or font directly in HTML, CSS or JSON without hosting a separate file on a server.
A Base64 string is about a third larger than the original file, so it only pays off for files of a few KB. For images, pick the CSS form to get a ready background-image line, or HTML to get an img tag with the file name.
How to use
- Choose a file or drag and drop it.
- Pick the output: data URI, Base64, CSS or HTML.
- Click Copy or Download file.
Frequently asked questions
Is the data I paste sent to a server?
No. The tool runs in JavaScript right in your browser, and Takikit has no server that receives data. You can turn off your internet after opening the page and the tool will still work.
Related tools
More Developer tools
Base64 DecodeConvert a Base64 string back to the original text. It also handles URL-safe Base64, missing = padding and data URIs.Hash GeneratorCalculate MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 for text or a file at the same time.SHA-256 Hash GeneratorCalculate the SHA-256 hash of text or a file using the Web Crypto API built into your browser.JSON String UnescapeConvert a string containing \n, \", \u00e1 back to plain, readable text.SHA-512 Hash GeneratorCalculate the SHA-512 hash of text or a file right in your browser.JSON String EscapeAdd \n, \", \\ correctly so a multi-line piece of text can be placed inside a JSON string.
See all developer tools