Convert to Base64

Convert common images or PDFs to Base64 after converting them to JPG. Images are re-encoded as JPG first; PDF pages become JPG images, and multi-page PDFs are packaged as a ZIP before encoding.
Drop or paste a file here
Accepted: JPG, JPEG, PNG, WEBP, GIF, BMP, AVIF, HEIC, JFIF, ICO, SVG, PDF.
Files stay on your device.
Check a file’s format
{{ result ? 'Base64 output for ' + imageToBeConverted.name : '' }}

{{ encodingError ? 'Couldn’t encode this file' : 'Encoding your file…' }}

{{ encodingError || imageToBeConverted.name }}

{{ displayOutputLabel }} file
Base64 output

{{ imageToBeConverted.name }}

Text format

{{ outputMime }} · {{ outputCharCount.toLocaleString() }} characters

{{ outputNote }}

{{ copyStatus }}

How to convert images to Base64

1. Choose an image

Choose an image or PDF file, or drag it onto the page.

2. Convert to Base64

We generate a Base64 data URL and show the preview so you can confirm the output.

3. Copy Base64

Choose full data URL or raw Base64, then copy the output with one click.

Data URL or raw Base64

Switch between a full data URL and Base64-only output.

Copy in one click

Copy the Base64 output straight to your clipboard.

Preview before copying

Check the preview to confirm the conversion.

Includes MIME prefix

Data URL output includes the correct MIME prefix.

JPG is encoded

The universal tool re-encodes images as JPG first. PDF pages also become JPG images, with multi-page results packaged as a ZIP.

Frequently Asked Questions

How do I use the Base64 output?

Paste the data URL into an image tag or CSS background, or copy the raw Base64 for APIs.

Why is the Base64 string long?

Base64 encodes binary data, so the string is larger than the original file.

Can I copy the output?

Yes. Use the copy button to place the output on your clipboard.

Does this encode my original file byte for byte?

No. This universal converter first creates a JPG result, then encodes that result. Transparency and metadata are not preserved. For PDFs, each page becomes a JPG and multi-page results are packaged as a ZIP before encoding.

What happens with multi-page PDFs?

Each PDF page is rendered as a JPG. The JPG files are packaged as a ZIP, and the ZIP is returned as a Base64 data URL.

What happens if a HEIC file contains several images?

The HEIC decoder exports the first image only. That image is converted to JPG and then encoded as Base64; additional images in the HEIC container are not included.