ImagesRuns in your browser

Image to Data URI and PNG Placeholder

Get the source file as a base64 string and create a separate tiny PNG placeholder without uploading the image to a server.

  • Up to 1 MiB
  • Placeholder up to 24 pixels
  • Local processing
Online tool

Try the tool

Add your data, choose the settings, and get the result.

Source image

The full Data URI contains every source byte and increases text size. The placeholder is a separate PNG up to 24 px, not BlurHash.

Result

Choose a file and create the two outputs.

Processing in your browser

Text and selected files are processed in the current browser and are not sent to a server to produce the result.

Reviewed: 2026-07-17
01

How to use it

  1. 1

    Choose one JPEG, PNG, WebP, or AVIF file.

  2. 2

    Create a Data URI of the source file and a tiny PNG placeholder.

  3. 3

    Copy the required Data URI or the ready-to-use CSS declaration.

02

What the tool can do

  • Detect the format from the file's byte signature.
  • Exact base64 encoding of every source-file byte.
  • A PNG placeholder that keeps the aspect ratio, with no side larger than 24 pixels.
03

Common use cases

  • Embedding a small local image in CSS or HTML.
  • Preparing a tiny placeholder for an image on a site.
  • Identifying the MIME type from the file content.
04

How it works inside

The source Data URI is built directly from the read bytes and displayed only as text.

The thumbnail is created from the image using Canvas in your browser.

05

Questions and answers

Why convert an image to a Data URI?

It lets you embed an image directly in HTML or CSS as one text string instead of linking a separate file. This can be useful for small resources. Converting to text does not compress the image and can increase data size.

How does an exact copy differ from a placeholder image?

Exact-copy mode preserves the selected file's bytes as text. Placeholder mode creates a separate small PNG for an initial preview. Choose the mode you need and inspect the result before using it in code.