SwiftToolpad

Encode image to Base64

Encode a JPG, PNG, or WebP image as a Base64 string or data URL.

Loading the file picker…Encodes the original image bytes locally without re-encoding or uploading.

How it works

Read the exact bytes of a still JPG, PNG, or WebP image locally and encode them as a raw Base64 string or MIME-qualified data URL. Decoding the output returns the identical file bytes.

Example · Encode a small SVG-free PNG badge as a data:image/png;base64,… string for inline HTML or CSS.

How to use this tool

  1. Choose a still JPG, PNG or WebP from your device. Keep your source photo available while you work on the copy.
  2. Choose a still JPG, PNG, or WebP file and select either a MIME-qualified data URL or raw Base64 output.
  3. Copy the Base64 string or download the text file, then verify the MIME prefix and character count against your target.

Common questions

Does encoding an image as Base64 change its pixels or dimensions?

No. The encoder reads the exact original file bytes in memory without decoding or recompressing the image, so decoding the Base64 output returns the identical file.

What files and sizes can I use?

Still JPG, PNG and WebP are supported. The input image can contain up to 26 megapixels and each side can measure up to 16,384 pixels. An animated image needs a still frame before you use it here. The selected file must be 40 MB or smaller.

Where do my files go?

Your browser reads the selected files on this device. SwiftToolpad does not upload the contents for processing. The download is a separate copy. You can reopen your original if you want to try different settings.