Convert an Image to a Base64 String
Encode an image as Base64 or a data URL you can paste into HTML, CSS or JSON. Copy it or download it as a text file.
How to use Image to Base64
Step by step
Add your file
Drag it into the box or click the box to choose it from your device.
Choose your settings
Set the options you need. The tool tells you if something is not supported.
Process and download
Press the button, check the result and download it.
Features and benefits
What you get
Runs in your browser
This tool processes your file on your device and does not upload it.
No sign-up
Open the page, add your file and download the result.
Clear error messages
Unsupported, protected or oversized files are explained.
Instant download
Save the result as soon as it is ready.
Supported formats and limitations
What to expect
Supported formats
JPG, PNG, WebP, GIF, BMP
Size limits
5 MB
Limitations
Large images produce very long text and are rejected.
Frequently asked questions
Quick answers
What is a data URL?
It is the Base64 text with a prefix such as data:image/png;base64, so a browser can show it directly.
Is there a size limit?
Images up to 5 MB are accepted here, because the text output becomes very long.
Related tools
More from Image Tools
JPG to PDF
Combine one or more images into a single PDF. Reorder them, choose the page size and margins, and download.
Scan to PDF
Turn photos of paper documents into a clean PDF. Take pictures with your phone camera or add images, clean them up (document black and white, enhanced colour or grey), rotate, crop, reorder and save.
Image Resizer
Change the pixel size of a JPG, PNG or WebP image: type exact numbers or drag handles on the picture to make it smaller or larger, with zoom and move controls.
Related guides
Read more about this tool
How to convert an image to Base64
Base64 turns a small image into text so it can be embedded directly in code instead of loaded as a separate file.
How to convert JPG images to a PDF
Turning photos and scans into a PDF makes them easier to send and print.
How to scan documents to PDF
A phone camera makes a quick scanner.