Add to Chrome Add to Edge

Image to Base64

Convert an image into a Base64 data URI to embed directly in HTML or CSS.

Encoded in your browser. Your photo is never uploaded.

Your photo
Output

Base64 is about a third larger than the file: becomes . Best for small icons and logos.


Image to Base64

A Base64 string lets you embed a small image directly in HTML, CSS or JSON instead of linking to a separate file. Upload the picture and the encoded string is produced in your browser.

How to use Image to Base64

  1. Add an image (PNG, JPG, WebP, GIF or SVG) under Upload Image to Base64.
  2. Click Convert to Base64.
  3. Copy the Base64 String into your code.

When it comes in handy

  • Inlining tiny icons and logos to save an extra HTTP request.
  • Embedding images in HTML emails, JSON payloads and test fixtures.
  • Storing small images in a database text field.

Frequently asked questions

Should I inline every image?
No. Base64 makes data about a third larger and cannot be cached separately, so it suits small images only. Keep large photos as normal files.
How do I use the result in CSS?
Prefix it with a data URI such as data:image/png;base64, and place it inside url() as a background image.

Related guides

Choose which cookies SEOpeck may use. You can change this at any time from "Cookie settings" at the bottom of every page.

Your tools

    Saved in this browser only. Nothing is sent to us.

    Popular tools