Free Image Tool

Image to Base64: Convert Images to Base64 Online

Upload a picture and this tool converts the image to Base64 text you can paste straight into code. It works with PNG, JPG, GIF, BMP, SVG and WebP. Free, no signup.

PNG to Base64 JPG to Base64 SVG to Base64 Upload or URL One-click copy Up to 5 MB No signup

Maximum upload file size: 5 MB

Use Remote URL
Upload from device
Base64 image encoder output pasted into an HTML img tag

Base64 Image Encoder for HTML and CSS

This Base64 image encoder turns your file into plain text. Paste it into an img src or a CSS background and the picture loads with no separate image request.

PNG to Base64 converter with a transparent icon

Convert PNG to Base64

Small PNG icons, logos and UI sprites are the most common files to encode. Upload the PNG, click Convert and copy the string. Transparency is kept, because Base64 stores the file exactly as it is.

SVG to Base64 encoded icon in a CSS file

SVG to Base64 for Inline Icons

Convert SVG to Base64 for logos and icons in CSS backgrounds and single-file pages. Base64 works in every browser and pastes cleanly, with no special characters to escape.

JPG to Base64 string inside a JSON request

JPG to Base64 for APIs and JSON

Need to send a photo inside JSON, an API request or a database text field? Convert JPG or JPEG to Base64 and the image travels as plain text.

image Base64 string with a data URI prefix

What an Image Base64 String Looks Like

A Base64 image is a long run of letters, numbers, + and / characters, often ending in =. With a prefix like data:image/png;base64, a browser reads it as an image.

Base64 of image compared with the original file size

When Base64 Images Make Sense

Base64 makes files about 33% larger, so it suits small images of a few KB. Keep large photos as normal files so browsers can cache them.

convert image to Base64 online in a browser

Convert Image to Base64 Online, No Code

No command line and no scripts needed to Base64 encode an image. The tool works in any browser on desktop or phone. Upload from your device or paste an image URL.

How to Convert an Image to Base64

1

Upload your image

Drop a PNG, JPG, SVG, GIF, BMP or WebP file up to 5 MB, or paste an image URL.
2

Click Convert

The tool will encode the image to Base64 in a second or two.
3

Copy the string

Press Copy Content to copy the full Base64 code to your clipboard.
4

Paste it into your code

Use it in an img src, a CSS url() or a JSON field.

Image to Base64 FAQs

How do I convert an image to Base64?

Upload the image, click Convert and press Copy Content. You get the whole encoded string in one click, ready for HTML, CSS or JavaScript.

How do I use a Base64 image in HTML?

Put the string in an img tag's src with a data URI prefix, like <img src="data:image/png;base64,iVBORw0...">. Swap png for jpeg, gif, webp or svg+xml to match your file.

How do I use a Base64 image in CSS?

Place it inside url(), for example background-image: url("data:image/png;base64,..."). This works well for small icons and patterns you don't want to load as separate files.

Does Base64 make images bigger?

Yes. Base64 adds about 33% to the size, because every 3 bytes become 4 text characters. That's why it suits small icons, not large photos.

Does encoding an image as Base64 reduce quality?

No. Base64 is an encoding, not compression. It stores the exact bytes of your file, so the image decodes back pixel for pixel.

How do I encode an image to Base64 in JavaScript?

In the browser, read the file with FileReader.readAsDataURL(). In Node.js, use fs.readFileSync(path).toString('base64'). This tool gives the same result without code.

Can I turn Base64 back into an image?

Yes. Paste the string into Base64 to Image to preview it and download the image file.

Is the image to Base64 converter free?

Yes. It's free with no signup. You can encode images up to 5 MB each.

Encoded? Make sure it decodes.

Paste the string into Base64 to Image to check it, or shrink the picture first with the Image Resizer.

Base64 to Image

Raheel Jakhura

CEO / Co-Founder

Our goal is to provide online free tools so you don't have to install any software for basic usages. We are trying to add more tools and make these tools free forever.

cookies image
We care about your data and would love to use cookies to improve your experience.