Convert images to Base64 data URIs to embed them directly in HTML, CSS, or JavaScript without separate HTTP requests. Useful for small icons, logos, and email templates. Reads image files locally and produces ready-to-use data URI strings.
Drop an image here or click to browse
Supports PNG, JPG, GIF, SVG, WebP, BMP, ICO (max 10.0 MB)
Drag and drop an image or click to browse and select a file. The tool reads the image using FileReader API and converts it to Base64 data URI. Copy the full data URI for HTML img tags and CSS backgrounds, or copy just the Base64 string for API payloads.
Embed small images (icons, logos under 10KB) directly in HTML or CSS to eliminate HTTP requests. Include images in JSON API payloads. Create self-contained email templates. Embed images in SVG files. Store thumbnails in databases or localStorage. Generate data URIs for Canvas API operations.
FileReader API reads the image as ArrayBuffer, then encodes to Base64 using btoa() or Uint8Array conversion. Data URI format: data:[MIME type];base64,[encoded data]. MIME types detected from file extension (image/png, image/jpeg, image/gif, image/svg+xml, image/webp). Base64 encoding increases size by ~33% due to 3-bytes-to-4-characters expansion.
Drag and drop an image file or click to upload. The tool reads the file using the FileReader API and converts it to a Base64-encoded data URI that you can copy and paste into your HTML or CSS.
This tool supports all common web image formats: PNG, JPEG, GIF, SVG, WebP, BMP, and ICO. The output data URI includes the correct MIME type for each format.
Base64 encoding increases file size by ~33%. It is best for small images (under 10KB) like icons and logos. For larger images, use optimized image files served via a CDN with modern formats like WebP or AVIF.
Use the data URI as the src attribute of an img tag: <img src="data:image/png;base64,iVBOR..." />. For CSS, use it as a background-image: url(data:image/png;base64,iVBOR...).
Transform, format, generate, and encode data instantly. Private, fast, and always free.
Browse All Tools