Utilities

Image to Base64

Convert images to base64-encoded strings for embedding directly in HTML, CSS, emails, and JSON payloads. Generates ready-to-use data URIs with the correct MIME type. Useful for eliminating external image requests in web pages and emails.

Features

  • Generates complete data URI with MIME type
  • Supports JPEG, PNG, WebP, GIF, and SVG encoding
  • Copy-to-clipboard for the encoded string
  • Shows encoded size vs original size
  • Batch convert multiple images

What you can do

  • Embed small icons as data URIs in CSS to reduce HTTP requests
  • Inline images in HTML email templates for guaranteed display
  • Convert images to base64 for inclusion in JSON API responses
  • Generate data URIs for use in SVG documents and inline styles

Self-hosted. Your images never leave your network.

SnapOtter runs entirely on your own infrastructure. Images processed with Image to Base64 are never uploaded to third-party servers. Deploy a single Docker container and process images with full privacy, no watermarks, and no usage limits. Open source under AGPL-3.0.

Frequently asked questions

When should I use base64 instead of a regular image file?
Base64 is best for very small images (icons, UI elements under 2-3KB) where eliminating an HTTP request saves more time than the 33% size increase from encoding. For larger images, use regular files.
Does base64 increase file size?
Yes. Base64 encoding increases the data size by approximately 33% because it converts binary data to text (3 bytes become 4 characters). This is why it is only recommended for small images.
Can I use a base64 image in CSS?
Yes. Use the generated data URI as a background-image value: background-image: url('data:image/png;base64,...'). This embeds the image directly in your stylesheet.

Ready to try Image to Base64?

Deploy SnapOtter in under a minute. All 50+ tools included. Open source and free forever.