Choose an image up to 8 MB, or paste a data URL.
Image & PDF Tools
Image ↔ Base64
Encode an image as Base64 or a data URL, and decode Base64 back into an image preview. Free, fast, and built for a clean browser workflow.
Related tools
Try these next
Base64 Encoder / Decoder
Encode and decode Base64 with UTF-8 support and optional URL-safe alphabet—fully local.
Image Compressor & Resizer
Resize, compress, preview, and download optimized images directly from your browser.
Photo Metadata Remover
See camera and location metadata on a photo, then download a copy with that metadata removed.
AI Background Remover
Remove image backgrounds locally and download a transparent PNG with before/after preview.
About this tool
This tool reads an image file in your browser and writes a Base64 data URL you can paste into HTML, CSS, or a JSON payload.
The other direction accepts a data URL or raw Base64, checks that it looks like an image, and shows a preview you can download.
Files stay on your device. Keep data URLs small — embedding a large photo in HTML makes the page heavier than a normal image file.
Tips for better results
- A data URL looks like data:image/png;base64, followed by the encoded bytes. Raw Base64 omits that prefix.
- Prefer compressed images first. Use the Image Compressor when the source is a large photo.
- The encoder accepts files up to 8 MB so the tab stays responsive.
- Some email clients and older browsers limit data URL length. A hosted file is safer for large pictures.
How to use
- 1 Choose an image to encode, or paste a Base64 string to decode.
- 2 Copy the data URL or the raw Base64 text.
- 3 When decoding, preview the image and download it.
FAQ
Which image types work?
PNG, JPEG, WebP, GIF, and other types the browser can read as an image file.
Is the image uploaded?
No. FileReader encodes it locally.
What is the difference between Base64 and a data URL?
Base64 is the encoded text. A data URL adds a prefix that browsers can use directly in an img src or CSS url().
Can I decode a string I paste?
Yes. Paste a data URL or raw Base64 image and the page previews it when the browser accepts the bytes.
Is there a size limit?
Yes. Encoding is limited to 8 MB per file.
Does encoding change the picture?
No. Base64 is a reversible text form of the same bytes.