Skip to main content
Convert.rest

Image to Base64 Converter — PNG, JPG, SVG Data URLs

Turn a PNG, JPG, WebP, GIF, BMP, AVIF or SVG image into a Base64 data URL right in your browser. Useful for embedding images in HTML, CSS, JSON or database columns — and private, because the image never leaves your device.

Drop an image here or click to browse

PNG, JPEG, WebP, GIF, BMP, AVIF or SVG — up to 10 MB. Processed locally.

Privately converted in your browser — the image is never uploaded.

The image is read into your browser’s memory with the FileReader API and converted to Base64 locally. No file bytes, filename or size information is ever transmitted — there is no upload endpoint on this page.

What it supports

  • Input: PNG, JPEG, WebP, GIF, BMP, AVIF and SVG files (up to 10 MB).
  • Output: a copy-paste-ready data URL (data:image/...;base64,...) and the raw Base64 payload.
  • Preview shown for raster images; SVG is offered as a download to avoid rendering untrusted markup.

How it works

  1. 1

    Pick an image

    Choose a file with the button, drag it onto the box, or paste it from the clipboard.

  2. 2

    Convert locally

    The tool reads and encodes the image in your browser — no upload happens.

  3. 3

    Copy or download

    Copy the data URL or raw Base64, or download either as a .txt file.

What this tool does

You pick an image and the tool reads its bytes and encodes them as Base64, producing two forms: a full data URL you can drop straight into an <img src="...">, and the raw Base64 payload without the prefix. Both are copied with a single button or downloaded as a .txt file.

Who it is for

Front-end developers embedding icons and illustrations in HTML or CSS, API designers generating test fixtures, and writers working with tools that accept image data as text — all without sending the image to a third-party encoder.

Choosing the output form

Use the data URL when you want an image the browser can render immediately from a string — it carries the MIME type inside the prefix. Use the raw Base64 when your target system already knows the format, such as sending image bytes in a JSON field alongside a separate type field.

Privacy and limits

Everything happens in the browser: the FileReader API reads the file into memory, conversion is plain JavaScript, and there is no server to receive the bytes. The 10 MB cap and the base64 size overhead are the only practical limits, and both are checked before the file is even read.

Limits & notes

  • Files up to 10 MB are accepted; bigger images would produce output too large to paste comfortably.
  • Base64 grows the payload by about 33%, so a 10 MB image becomes roughly 13 MB of text.
  • Preview is provided for raster formats. SVG files convert and download, but are not injected into the page as markup.

Frequently asked questions

Yes — the SVG is converted to a Base64 data URL and can be copied or downloaded. For safety the page does not render arbitrary uploaded SVG markup as an inline preview; use the download to keep the file valid.