Skip to content

Convert image to Base64

Convert an image to a Base64 string (data URL) ready to embed in HTML or CSS.

Processed on your device. Nothing is sent to any server.

or click to select it

Convert an image to a Base64 string (data URL) that you can embed directly in HTML, CSS or JSON without a separate file.

Reads the file with the browser's FileReader API and encodes it as a data URL, the standard format for embedding binary files as text.

Use cases

  • Embedding a small icon directly in CSS without an extra HTTP request.
  • Adding an image to a configuration JSON.
  • Quickly testing an image in a prototype without uploading files.

How it works

  1. 1

    Upload your image

    Drag the file in or pick one from your device.

  2. 2

    Copy the result

    The Base64 text (data:image/...;base64,...) appears ready to copy.

Frequently asked questions

Is Base64 a good idea for large images?
No, Base64 increases file size by around 33% and can't be cached separately; it's best for small icons, not photographs.
Image