Image to Base64
Turn an image into a Base64 data URI, img tag or CSS line, without uploading it.
Works in your browser. Text and files never leave your device.
Everything happens in your browser. Text and files never leave your device.
Image to Base64 at a glance
- Price
- Free
- Data sent to us
- None, it runs in your browser
- Sign-up
- Not needed
- Encodes
- Text or any file
- Decodes to
- Text, or a file of the detected type
- Options
- URL-safe, line breaks, data URI
How to use Image to Base64
- Choose the directionEncode turns text or a file into Base64; Decode turns Base64 or a data URI back.
- Put in the inputType or paste into the left box, or choose or drop a file. The result appears on the right as you type.
- Copy or downloadPress Copy for the text, or Download to save it as a file. A decoded image or document downloads with the right extension.
Drop a PNG, JPG, SVG, GIF or WebP and copy its Base64 data URI, or a ready HTML img tag or CSS background-image line, straight into a page, an email template or a stylesheet. The size after encoding is shown, since Base64 adds a third; it is best for icons and small graphics. The image is read in your browser and never uploaded.
How it works
Image to Base64 is a web page that does its work on your own device. The file you choose is opened by your browser, changed there and saved from there; it is never sent to a server, so there is no copy of it anywhere to delete, no queue and no waiting for an upload. Most online tools of this kind send your file to their servers and work on it there, and many keep it for a while. This one does not. There is no account, no watermark and no limit on how often you use it, and the result downloads the moment it is ready.
When to inline an image
Inline small images that appear on every page, such as icons and logos under a few kilobytes, or when a single HTML file must carry its own pictures, as in an email template or a report. Large photos are better as ordinary files, which the browser can cache.
Questions
Which image formats work?
Any file works; the type in the data URI comes from the file. PNG, JPEG, GIF, WebP, SVG, AVIF and ICO are the ones browsers display from a data URI.
Other shortcuts
Base64 Encoder and Decoder · Base64 Decode


