About this tool
Image to Base64 converts your image to a base64-encoded data URI and provides ready-to-copy CSS background-image and HTML img tag snippets. No file is ever sent to a server — encoding happens entirely in your browser.
How it works
- 1Upload any image.
- 2Choose PNG or JPEG encoding (with quality slider for JPEG).
- 3Select Full Data URI or Raw Base64 output format.
- 4Copy the result, the CSS snippet or the HTML snippet with one click.
Common use cases
- ✓Embedding images in CSS without HTTP requests
- ✓Inlining images in HTML emails
- ✓Storing small images in localStorage or JSON
- ✓React and Vue inline image props
Privacy first. Image to Base64 runs entirely inside your browser using the HTML5 Canvas API. Your images are never uploaded to any server, stored anywhere or shared with third parties. Everything happens locally on your device.
More Export & Format tools
Format Converter
Convert images between PNG, JPEG and WebP with live size preview.
JPEG Compressor
Compress JPEG images with a quality slider and live size stats.
PNG Optimiser
Optimise PNG images by choosing colour depth and bit depth.
WebP Converter
Convert any image to WebP with quality control and lossless mode.
Favicon Generator
Generate all favicon sizes from one image and download as a ZIP.
Social Media Sizer
Resize images to the exact dimensions of any social media platform.