Image to Base64
Drop an image here, paste it, or choose a fileChoose an image from your device
PNG, JPG, WebP, GIF, SVG, HEIC and more · never leaves your device
About
A data URL carries a file inside the text of a page: a short header such as data:image/png;base64, followed by the file's bytes written as Base64. The image then needs no separate request, which suits small images such as icons and logos - for larger ones, the extra third in size and the loss of separate browser caching usually cost more than the request saves.
How to use
1.
Choose an image, drop it onto the page, or paste it from your clipboard
2.
Copy the data URL from the Data URL panel, or download it as a .txt file
3.
Paste it into an img src, a CSS url() or your code - use Replace to encode another image
Common uses
▸
Inlining small icons and logos in HTML or CSS to save a separate request
▸
Building a single-file HTML page, demo or report that works without its image files
▸
Sending an image to an API that expects Base64 in a JSON field
▸
Embedding sample images in test fixtures or mock data
Similar tools
Frequently asked questions
What can I do with the Base64 output?
Use it anywhere an image URL is accepted - an img src attribute, a CSS background-image url(), an SVG image href - or put the image in JSON and other text-only formats. The output is a complete data URL; if an API expects only the Base64 part, remove everything up to and including the comma.
How much bigger is the Base64 version?
About a third bigger: every 3 bytes of the file become 4 characters of text, plus the short data:image/...;base64, header. The Data URL panel header shows the size of the encoded string, and the original file size is shown under the preview.
Is my image uploaded to a server?
No. The image is read and encoded entirely in your browser using the FileReader API. No image data is transmitted anywhere.
What image formats are supported?
Any image file - PNG, JPEG, WebP, GIF, SVG, AVIF, BMP, ICO, TIFF, HEIC and others. The file is encoded byte for byte, without re-compressing it, so the data URL holds exactly the original image. If your browser cannot preview the format (most browsers other than Safari cannot show HEIC or TIFF), it is still encoded in full.
Is there a file size limit?
There is no fixed limit. Above 100,000 characters (an image of about 73 KB) the Data URL panel shows only the start of the string, to keep the page responsive - Copy and Download always give you the full string. Data URLs that long are rarely practical, so compress large images first.