Image to Base64
Turn a picture into Base64 text you can paste into code.
How to use Image to Base64
- 1Choose an image.
- 2Pick Data URL, Base64 only, HTML img tag or CSS.
- 3Press Copy or download the text file.
About this tool
Base64 is a way to write a file as plain text. Developers use it to place small images directly inside HTML, CSS, emails and JSON, which saves an extra request to the server.
Base64 text is about one third bigger than the original file, so it is best for small icons and logos. The conversion happens in your browser and your image is not uploaded.
Frequently asked questions
What is a data URL?
A data URL starts with data:image and contains the whole picture as text, so it can be used as an image source without a separate file.
Is Base64 encryption?
No. It only changes how the file is written and anyone can decode it.
Which images should I embed?
Small icons and logos. Large photos make the page heavy and are better as normal files.