Image to Base64
Turn a small image into a Base64 data URI you can paste straight into HTML, CSS, JSON or email templates.
Result
Choose an image to get its Base64 data URI.
How to use this tool
- Add an image (up to 10 MB).
- Choose the output: a full data URI, plain Base64, an HTML <img> tag (with width and height) or a CSS background-image rule.
- Copy the result with Copy result.
How it works
The original file bytes are encoded exactly as they are — no re-compression — using Base64, which represents every 3 bytes as 4 text characters. A data URI adds the file type in front: data:image/png;base64,….
Example
Size overhead
A 3 KB icon becomes about 4 KB of Base64 text — Base64 is always about a third larger than the file.
Privacy and limitations
- The image is read on your device and never uploaded.
- Data URIs are best for very small images (icons, tiny backgrounds). Large inline images make pages heavier and cannot be cached separately.
Frequently asked questions
When should I inline images as Base64?
For tiny images where saving an extra request matters, in HTML emails, or when a single self-contained file is needed. For normal images, separate files are faster.
Can I convert Base64 back to an image?
Yes — paste the data URI into a browser address bar, or decode it with the Base64 tool.