Drop a file here or click to choose
Your file stays on your device. Processing happens locally in your browser.
What is Image ↔ Base64?
Image ↔ Base64 turns a picture into a Base64 data URI — or just the Base64, a ready CSS background rule or an <img> tag — and turns Base64 back into a file. Both directions run in your browser, so neither the image nor the pasted text is uploaded. When decoding, the file type is read from the bytes themselves, not from the data: label, and you are told if the two disagree.
Convert images to Base64 data URIs or decode Base64 back to files. Useful for inline CSS/HTML and APIs — free image to Base64 online on Fah Swe Tools, encoded and decoded on your device.
Key features
- Image to data URI, plain Base64, CSS background-image or HTML <img> tag
- Base64, data URIs, CSS url(…) and <img> tags back to a file
- File type decided by the decoded bytes, with a note when the label is wrong
- URL-safe Base64 and line breaks accepted
- One-click copy and a .txt / .css / .html download
- Runs in your browser — nothing is uploaded
Popular uses
- Inline small icons in CSS to save HTTP requests
- Send images through JSON APIs
- Recover an image from a Base64 string in logs
Supported formats
Encode: JPG, PNG, WebP, AVIF, HEIC/HEIF, GIF, BMP, TIFF, SVG, ICO (up to 25 MB). Decode: Base64 or data URI to JPG, PNG, WebP, AVIF, GIF, BMP, ICO, HEIC, TIFF or SVG; anything else is saved as .bin.
Troubleshooting
- “That isn't valid Base64” Something other than Base64 slipped in — often quotes or a CSS property name. Paste just the data URI, or the whole url(…) or <img> tag and the tool will pick the data URI out.
- “That Base64 looks cut off” Long strings are often truncated when copied from logs or chat apps. Copy the full value again.
- My SVG has no preview SVG files can contain scripts, so decoded SVGs are offered as a download only.
Also known as: Base64 to Image, Image Data URI Generator, Base64 Image Encoder.
How it works
- Pick Image → Base64 and choose a picture, or pick Base64 → image and paste a data URI or plain Base64.
- Copy the string or download the file. A decoded file's type comes from its bytes, not from its label.
FAQ
Why Base64?
Embed small images in CSS/HTML or APIs without separate files.
Is my image or text uploaded?
No. Encoding and decoding both happen in your browser.
How do I use a Base64 image in HTML?
Choose the HTML <img> tag output, or copy the data URI into <img src="data:image/png;base64,...">.
Is Base64 bigger than the original image?
Yes, about 33% larger, so use it only for small images.