Image to Base64

Converts images to Base64, Data URL, CSS or HTML form — processed locally with preview, never uploaded.

EncodingInstant

Parameters

No file selected

Up to 5 MB per file.

Result

Fill in the parameters and run

Convert images to Base64 and Data URLs

Pick an image (PNG, JPG, SVG, WebP, GIF, up to 5MB) and get four ready-to-use forms instantly: a Data URL (paste into a browser address bar or Markdown), the raw Base64 string, a CSS background-image declaration, and an HTML img tag. The output panel shows a preview so you can confirm the right file was converted. The conversion happens entirely in your browser — the essential difference from typical “online converters”: your image never leaves your device.

Embed small images in CSS, HTML and Markdown

Inlining small icons or loading spinners into CSS or HTML to save an HTTP request and speed up first paint; embedding images in email templates, where most clients block external images; embedding small images in Markdown or JSON configs; standing in for not-yet-deployed static assets during front-end integration.

Base64 image size and caching tradeoffs

Base64 inflates size by about 33%, and inlined images cannot be cached separately — only inline small images (rule of thumb: under 10KB, icon-sized). Inlining large images bloats the HTML and slows the first paint instead. SVGs are better inlined as markup than as Base64: smaller and styleable with CSS. This tool does not compress or alter the image; run it through an image compressor first if size matters.

Loading assistant…