Tools95

MAKE SOMETHING GREAT

Image to Base64 Converter.

Convert PNG, JPG, WebP and other images to Base64, data URLs, HTML or CSS. Preview, copy the code or download a text file. Encoding stays on your device.

Advertisements
Your image workspace
On your device
or drag and drop here
PNG, JPG, JPEG, WEBP, GIF, BMP, AVIF
Choose your image to get started.IMAGE
Advertisements
Blog How to convert an image to Base64 Read the guide

Convert an image to Base64 without changing its bytes

Turn an image into Base64, a data URL, an HTML image or a CSS background. Preview the source, choose the code format, then copy it or download a text file. Encoding runs on your device.

An image becomes reusable code, and valid image code becomes an image again.
QUICK VIDEO TUTORIAL How to encode an image as Base64 or HTML Choose an image, select HTML image code and download the encoded image as a text file. English narration Watch the video

How to encode an image as Base64 or HTML

Features and controls

Encode the actual image bytes

Select an image and open the editor to see its encoded form.

What encoding preserves

Encoding reads the selected file without resizing or recompressing it. Its existing image data, metadata and animation bytes remain in the Base64 string. The preview is for identification; it is not used to recreate the output. Encoding changes how the bytes are represented, not the image content.

Choose the code your project needs

Switch between Data URL, Plain Base64, HTML image and CSS background.

Choosing a code format

Data URL includes the image MIME type and base64 prefix. Plain Base64 contains only the encoded bytes. HTML image wraps the data URL in an img tag with an empty alt attribute that you should fill for meaningful content. CSS background wraps it in a background-image declaration. Use the form expected by the application receiving the code.

Copy code or download it as text

The copy icon uses the shared visual confirmation.

Copy and TXT download

Select the copy icon above the code to place the currently selected representation on the clipboard. Start opens the download page with a TXT file. The text filename keeps your image basename and adds -base64. If clipboard access is blocked, the text is selected so you can copy it manually.

Check the size before embedding

The editor shows the image size and the size of the generated code.

Why Base64 is usually larger

Base64 commonly adds about one third to the original byte count, plus any data URL or HTML/CSS wrapper. It can be useful for small embedded assets and self-contained documents, but it is not image compression. Large embedded images can make HTML or stylesheets difficult to maintain and cannot be cached separately from their containing file.

Keep a local conversion workflow

Image encoding and decoding do not require an upload.

Supported files and limits

Supported formats are PNG, JPG, WebP, GIF, BMP and AVIF, subject to your browser being able to preview them. Images must be no larger than 25 MB, 60 megapixels or 16,000 pixels per side. SVG markup is deliberately not accepted by this raster converter.

Files and processing

Input
PNG, JPG, WebP, GIF, BMP or AVIF image
Output
TXT containing Data URL, Plain Base64, HTML image or CSS background

25 MB maximum per file. One input file per run.

One image up to 25 MB, 60 megapixels and 16,000 pixels per side.

The selected image is read and encoded in the browser without uploading it for conversion.

This tool processes and exports files in your browser. The downloaded image is a separate file; the source on your device is not overwritten.

Refreshing an editor or download page returns you to the tool page. Download the result before starting a new workflow. See our Privacy Policy for file handling.

FAQ

Good to know.

A few answers before you get started.

On your device
Will encoding reduce image quality?

No. Encoding preserves the original bytes. It does not resize, compress or redraw the image.

Why is the Base64 string larger than the image?

Base64 represents three input bytes using four text characters, so it normally adds about one third before a wrapper or prefix.

Are GIF animations preserved?

Yes. Encoding preserves the original GIF bytes, including animation. A preview may show a still frame while the encoded data retains all frames.

Is Base64 safe for secret images?

Base64 is not encryption. Keep the string private if the underlying image is private. The converter itself processes it locally in your browser.

Advertisements

Language38

English العربية Français Italiano Deutsch Español Português Nederlands Русский Türkçe 日本語 中文 हिन्दी Bahasa Indonesia Bahasa Melayu 한국어 Tiếng Việt ไทย Polski Svenska Українська Norsk বাংলা Ελληνικά فارسی اردو Čeština Dansk Magyar Română Suomi Български Filipino ქართული Slovenčina Azərbaycanca עברית Slovenščina

Choose your language. Video tutorials currently use English narration.