My Learning

Keep this for later

Sign in or create a free account to save it. You’ll return to this page afterward.

Sign inCreate an account

Image to Base64

Encode a small image as a Base64 data URI for development use.

JPEG, PNG, WebP and still GIF images are supported. Maximum 2 MB and 4 megapixels. Images are processed for this response and are not published as files. Base64 output is limited to source files of 512 KB.

How to use this tool

Upload a JPEG, PNG, WebP or GIF image no larger than 512 KB.

Important to know

Encode a small image as a Base64 data URI for development use.

Base64 increases text size and can hurt page performance; prefer normal image URLs for larger assets. No public file is created.

Formula and methodology

Read the validated image bytes and encode them as data:;base64,.

Example

A PNG file begins with a data:image/png;base64, prefix in the result.

Frequently asked questions

Does this compress the image?

No. Base64 represents the same bytes as text and is usually longer.