Free Image to Base64
Convert an image to a Base64 data URI for inline use in CSS, HTML, or Markdown. Copy ready-made snippets. Encoded in your browser; never uploaded.
Drop a file here, or click to browse
PNG, JPG, WebP, GIF, SVG, AVIF, ICO, HEIC, HEIF Β· processed on your device
or press Ctrl+V to paste from your clipboard
Tip: you can also paste an image from your clipboard (Ctrl+V).
Your files never leave your device. All processing happens locally in your browser.
Convert an image to a Base64 data URI you can paste directly into CSS, HTML, or Markdown β no separate file needed. Encoded in your browser; never uploaded.
Common uses
- Inline an Image in CSSEmbed a small icon or background as a data URI in your stylesheet.
- Embed an Image in HTMLInline a logo or icon directly in self-contained HTML.
- Convert an SVG or Icon to Base64Turn a small icon into a data URI for inlining.
- Embed an Image in MarkdownInline a small image in a Markdown file with a data URI.
- Get an Image Data URIProduce a raw data: URI you can use anywhere.
How It Works
A data URI embeds an image directly into your code as text, so it loads without a separate file request β handy for small icons and self-contained HTML. This encodes it in your browser.
- 1You drop in an imageIt's read locally with the FileReader API β never uploaded.
- 2It's Base64-encodedThe image bytes become a data: URI (data:image/...;base64,β¦) right in your browser.
- 3You pick a snippetCopy the raw data URI, or ready-made CSS (background-image), HTML (<img>), or Markdown.
- 4Paste it into your codeThe image now travels inline with your CSS/HTML β no extra file to host.
The image is encoded entirely on your device. Note that Base64 is ~33% larger than the original, so data URIs are best for small images.
Related Tools
Image Steganography (Hide Text in Image)
Hide a secret text message inside a PNG using least-significant-bit steganography, with optional AES-256-GCM password encryption. Extract it later with the same tool. Everything runs in your browser.
Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to plain text. Instant, private, and free.
URL Encoder & Decoder
Encode and decode URLs and query strings. Supports encodeURIComponent, decodeURIComponent, and query string parsing.