🖼️ Base64 Image Encoder
Encode images to base64 data URIs or decode base64 strings back to previewable images. All processing happens in your browser.
Base64 Image Encoder & Decoder
This tool converts images to base64-encoded data URIs and back. Encoding images as base64 allows you to embed them directly in HTML, CSS, or JSON without separate file references. All processing is done locally in your browser.
Use Cases
- Email templates: Embed images directly in HTML emails.
- Single-file apps: Include small icons inline.
- API responses: Return images as base64 strings in JSON.
- CSS backgrounds: Use data URIs for small background images.
Frequently Asked Questions
What is base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It is commonly used to embed images directly in HTML, CSS, or JSON files as data URIs, eliminating the need for separate image files.
Why encode images as base64?
Base64-encoded images can be embedded directly in HTML or CSS using data URIs, reducing the number of HTTP requests. This is useful for small icons, email templates, and single-file applications. However, it is not recommended for large images.
How much larger is a base64-encoded image?
Base64 encoding increases file size by approximately 33%. For example, a 100 KB image will become about 133 KB when base64-encoded. This is because every 3 bytes of binary data become 4 characters in base64. For large images, this size increase can significantly impact performance.
Related Tools
JSON Formatter · HTML Minifier · Regex Tester · URL Encoder · All Developer Tools