Data URL / Base64 Image Converter

Encode a local file as a data URL or decode a data URL into a file, then compare the bytes in Three.js.

  • File & Data
  • Runs in your browser
  • Free, no signup

How to use

How to Use Data URL / Base64 Image Converter

  1. 1

    Upload a file

    Select an image, font, or other file to convert.

  2. 2

    Generate the data URL

    Click convert to create the base64-encoded data URL string.

  3. 3

    Copy the result

    Click copy to grab the data URL for use in CSS or HTML.

The guide

Tested tool guide Tested browser tools Checked November 28, 2026

What Data URL / Base64 Image Converter does, with a checked example

Choose File to Data URL to encode a local file. Choose Data URL to File to decode a Base64 or percent-escaped data URL. The file’s media type and byte count are displayed with the result.

Worked example

A concrete input and expected output from the current implementation.

Input

Paste data:text/plain;charset=utf-8,caf%C3%A9 in Data URL to File mode.

Expected output

The preview reads café and the download contains five UTF-8 bytes.

The percent escapes represent the two UTF-8 bytes for é.

How the result is produced

1

Choose a conversion direction

An uploaded file produces a data URL with a media type and Base64 marker. The decode direction reads the prefix and its payload.

2

Inspect the byte result

The tool shows the exact decoded size and previews text or supported raster images. The Three.js cards compare the first 48 file bytes with the encoded text.

3

Copy or download

Copy Data URL copies the full string. Download File writes the local bytes.

Good uses

  • Create a data URL for a small file.
  • Recover a file embedded in a data URL.
  • Check whether a text data URL uses percent escapes or Base64.

Limits and checks

  • Use files and decoded payloads up to 2 MiB.
  • Keep the comma between metadata and payload.
  • Check the filename and media type when sharing the downloaded bytes.

Common questions

Do all data URLs use Base64?

A data URL can use percent escapes or a Base64 payload. The base64 marker tells the decoder which byte representation to read.

Can I copy a long result?

Copy Data URL copies the whole value, even when the text box shows the first 4,000 characters.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.