Convert an image to Base64

Get a data URI, Base64 string, HTML img tag or CSS rule for any image.

or drop them here · paste with Ctrl+V

What it does

Embed small images straight into HTML, CSS, JSON or email templates. Drop an image to get its Base64 string as a data URI, raw Base64, a ready-made <img> tag or a CSS background rule, then copy it with one click.

How to use it

  1. Click “Choose images”, drop one or more images onto the box, or paste with Ctrl+V (⌘+V on a Mac).
  2. Pick what you need: a data URI, raw Base64, an HTML <img> tag or a CSS background rule.
  3. Click “Copy” to put it on your clipboard, or download it as a .txt file.

Common uses

  • Embedding small icons and logos directly in HTML or CSS
  • Storing images inside JSON, configuration files or test fixtures
  • Quick placeholders in prototypes without hosting an image

Tips

  • Optimize SVGs or compress PNGs first: every byte you save removes about 1.33 characters of Base64.
  • Keep large images as normal files. Browsers cache them separately, which Base64 can’t do.

Questions

Why is the Base64 text bigger than my image?

Base64 uses 4 characters for every 3 bytes, so the text is about 33% larger than the original file.

When should I use Base64 images?

For small icons, logos and placeholders, usually under 10 KB, where saving a network request matters. Larger images load faster as normal files because browsers can cache them.

Does it work with SVG and GIF?

Yes. SVG, PNG, JPG, WebP and GIF all work, and the data URI keeps the original file type.

Related tools

  • Compress images

    Shrink image file size without visible quality loss. Private, fast, free.

  • Convert HEIC to JPG

    Convert iPhone HEIC photos to JPG instantly. Files never leave your device.

  • Resize images

    Resize JPG, PNG and WebP images to exact pixel dimensions or by percentage. Keep the aspect ratio, resize in bulk, no upload.

  • Passport & ID photo maker

    Make a passport or ID photo at the right size for the US, UK, Canada and more, plus a 4×6 inch print sheet. Free, private, no upload.

  • Convert images to PDF

    Combine JPG, PNG and other images into one PDF in your browser. Reorder pages, pick A4 or Letter, no upload and no watermark.

  • Crop an image

    Crop photos in your browser: free-form, square for profile pictures, or a circle with a transparent background. No upload, no watermark.